Skip to content

Instantly share code, notes, and snippets.

View theevocater's full-sized avatar
🐈‍⬛

Jake Kaufman theevocater

🐈‍⬛
View GitHub Profile
gcc -std=c++11 main.cpp
/tmp/ccg9pIuw.o: In function `parseLineAndInsertWords(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
main.cpp:(.text+0x2d): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'
main.cpp:(.text+0x50): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long)'
main.cpp:(.text+0x81): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::substr(unsigned long, unsigned long) const'
main.cpp:(.text+0xa7): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
main.cpp:(.text+0xe3): undefined reference to `std::__
@theevocater
theevocater / ergodox.json
Created February 5, 2018 21:09
Ergodox json for my current layout
{
"header": {
"Name": "MDErgo1",
"Variant": "standard",
"Layout": "Default",
"Base": "Blank",
"Version": "0.1",
"Author": "HaaTa (Jacob Alexander) 2015",
"KLL": "0.3c",
"Date": "2015-09-12",
@theevocater
theevocater / gist:474a9e751f7e765231086cab2d7a63ea
Last active October 4, 2016 12:59
Sierra upgrade woes / things

Just a short list of things I had to do during my sierra upgrade to get back to ship shape.

Homebrew

Accept the new xcode license so you can use git etc:

sudo xcodebuild -license

Take control of /usr/local again. You may not need to do this if you have a more recent homebrew than I did. homebrew now lives in /usr/local/Homebrew:

@theevocater
theevocater / atomic_bool.go
Last active September 24, 2015 20:51
Atomic bool in go
package main
import (
"sync/atomic"
)
type AtomicBool struct {
value *int32
}
@theevocater
theevocater / load.sh
Created March 24, 2015 20:22
load git stuff osx
# load git completion
# we can depend on git-completion locally
if [[ -f $(brew --prefix)/etc/git-completion.bash ]] ; then
. $(brew --prefix)/etc/git-completion.bash
fi
# load these separately because git-prompt was introduced with git-1.8
if [[ -s $(brew --prefix)/etc/git-prompt.sh ]] ; then
. $(brew --prefix)/etc/git-prompt.sh
fi
@theevocater
theevocater / gist:adb46e28387c0c2f2845
Created January 9, 2015 23:51
Annoyed that homebrew's version of macvim can't be found by spotlight? I have a fix!
brew linkapps
osascript -e "tell app \"Finder\" to make new alias file at POSIX file \"/Applications\" to POSIX file \"$(stat -f%Y /Applications/MacVim.app)\"" && rm /Applications/MacVim.app;
@theevocater
theevocater / compile_weirdness.rs
Last active August 29, 2015 14:06
I was messing around with closures and ran into an odd problem with lifetimes and borrowing.
// these two I just don't understand why neither works.
fn it_does_not_works() -> String {
let mut output_string = String::new();
let do_a_thing: || -> () = | | {
output_string;
};
do_a_thing();
return output_string;
@theevocater
theevocater / gist:7763047
Created December 3, 2013 02:41
A snippet of bash to download the latest version of the git completion files locally and keep track of what version they are on
update_git_completion () {
# try to download the "correct" version of git completion
git_version=`git --version | cut -d" " -f3`
# check if we have the right version of git completion stuffs
if [[ -f git-completion.bash && -f git_completion_version && $git_version == `cat git_completion_version` ]]
then
echo "Up to date for $git_version"
else
# save the git version number
@theevocater
theevocater / gist:5854426
Created June 24, 2013 22:50
In which I try to compile 1 file with sbt
$ sbt
show sources
[info] Set current project to aw (in build file:/Users/jacobdeamkaufman/Code/aw.scala/)
> show sources
[info] ArrayBuffer(/Users/jacobdeamkaufman/Code/aw.scala/Expr.scala)
[success] Total time: 0 s, completed Jun 24, 2013 10:36:20 PM
> compile
[info] Updating {file:/Users/jacobdeamkaufman/Code/aw.scala/}default-60d9ca...
[info] Resolving org.scala-lang#scala-library;2.10.2 ...
[info] Done updating.
@theevocater
theevocater / gist:5846663
Created June 23, 2013 21:46
Trying to get a "scala" version of https://github.com/lkuper/aw/ and have to do this to get it to :load in the REPL. The REPL only recognizes companion objects defined on the same line as the original class so here we have everything defined on the same "line". If I'm wrong someone please tell me how to make this less awkward.
abstract class Expr {
}; case class Number(a: Int) extends Expr {
}; case class Plus(a: Expr, b: Expr) extends Expr {
}; case class Times(a: Expr, b: Expr) extends Expr {
}; case class Minus(a: Expr, b: Expr) extends Expr {
}; object Expr {
def interp(expr: Expr): Int =
expr match {
case Number(a) => a