Skip to content

Instantly share code, notes, and snippets.

View collinvandyck's full-sized avatar
🏠
Working from home

Collin Van Dyck collinvandyck

🏠
Working from home
View GitHub Profile
#![allow(unused)]
use anyhow::{Result, bail};
use core::panic;
use itertools::Itertools;
fn main() {
}
#[derive(Debug)]
#![allow(unused)]
use anyhow::{Context, Result, bail};
use core::panic;
use std::rc::Rc;
fn main() {
}
type SharedExpr = Rc<Expr>;
use std::{
fmt::{Debug, Display},
mem,
};
fn main() {
let mut list = List::new();
list.add(42);
list.add(1);
list.add(5);
@collinvandyck
collinvandyck / actionlist.vim
Created August 6, 2023 15:36 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@collinvandyck
collinvandyck / tree.rs
Created May 27, 2023 20:04
first rust binary tree
use rand::Rng;
use std::fmt::Display;
fn main() {
let mut rng = rand::thread_rng();
let mut t = Tree::new();
for _ in 0..10 {
let v = rng.gen_range(0..100);
t.add(v)
}
package main
import (
"bytes"
"math/rand"
"time"
tea "github.com/charmbracelet/bubbletea"
)
package encryption
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/rsa"
"fmt"
"testing"

Since the latest update (2018.3) i've run into a number of issues:

Support for import aliases

I am importing some go packages that have different package names from what their import url would suggest. Previously it was able to deal with this. Now, Goland will sometimes delete a whole bunch of imports. I found after some trial and error that this mostly happened with these kinds of imports. I'm able to "fix" it by defining an alias for that import and then using the alias.

Commit dialog issues with File Watchers

When I try to commit code through the editor, I will frequently get an error dialog saying that the commit failed because something else (the file watcher) is writing to disk. I have to cancel the commit, let it save, and then recommit. My work around for this is to just do my commits in a separate terminal application.

type waitGroup struct {
sync.WaitGroup
}
func (wg *waitGroup) DoneChan() chan struct{} {
ch := make(chan struct{})
go func() {
defer close(ch)
wg.Wait()
}()
package main
import (
"math/rand"
"testing"
)
type mapType map[int64]struct{}
type sliceType []int64