Skip to content

Instantly share code, notes, and snippets.

View yurrriq's full-sized avatar
🙉
I may be slow to respond.

Eric Bailey yurrriq

🙉
I may be slow to respond.
View GitHub Profile
@yurrriq
yurrriq / lein-deps-tree.clj
Created August 24, 2015 06:41
Typed Clojure can't initialize
[cheshire "5.5.0"]
[com.fasterxml.jackson.core/jackson-core "2.5.3"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.5.3"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.5.3"]
[tigris "0.1.1"]
[cider/cider-nrepl "0.9.1"]
[org.tcrawley/dynapath "0.2.3" :exclusions [[org.clojure/clojure]]]
[clojure-complete "0.2.3" :exclusions [[org.clojure/clojure]]]
[expectations "2.1.3" :exclusions [[org.clojure/tools.reader]]]
[joda-time "2.7"]
@yurrriq
yurrriq / type-error.txt
Created August 24, 2015 07:12
Annotation binary.clj
Polymorphic function reduce could not be applied to arguments:
Polymorphic Variables:
a
c
Domains:
[a c -> (t/U (Reduced a) a)] a (t/Option (Seqable c))
Arguments:
[(t/U Number nil) Character -> (t/U nil Number) :filters {:then (& (! (t/U nil false) 0) (is Number 0)), :else tt}] (t/Val 0) String
@yurrriq
yurrriq / map_literal_syntax.erl
Last active September 25, 2015 22:53
Erlang map literal syntax
%% I can't seem to commit the map literal syntax to memory,
%% so I'm making this gist.
Map = #{testing => 123,
cool => true,
heterogeneous => [<<"You">>, "know", it]}.
%% => #{cool=>true,heterogeneous=>[<<89,111,117>>,[107,110,111,119],it],testing=>123}
is_map(Map).
%% => true
@yurrriq
yurrriq / rlwrap-kjell.fish
Last active September 30, 2015 08:43
rlwrap ➕ kjell = 😎
rlwrap -a 'dummy' kjell -pa ebin -pa deps/*/ebin -I include -I deps/gpb/include
@yurrriq
yurrriq / unexpected-case-behaviour.org
Last active December 24, 2015 06:50
LFE: Unexpected case behaviour

The following returns eq, but I want it to return ne. What gives?

(let ((x 1)
      (y 2))
  (case x
    (y 'eq)
    (_ 'ne)))

In Erlang, however, the following returns ne, as desired.

@yurrriq
yurrriq / not-so-lazy.org
Created October 23, 2015 07:01
Swift: Not so lazy?

Swift: Not so lazy?

Setup

extension Array {
  func findFirst(p: Element -> Bool) -> Element? {
    return self.lazy.filter(p).first
  }
}

let arr: [Int]       = [1,2,3,4,5,6,7,8,9,10]
@yurrriq
yurrriq / lodox-0.0.2_lutil-0.7.0.org
Last active November 2, 2015 11:05
lodox-0.0.2 output for lutil-0.7.0
> (ld-util:get-versions)
(#(erlang "18")
 #(emulator "7.1")
 #(driver-version "3.2")
 #(lfe "0.10.0")
 #(lutil "0.7.0")
 #(lodox "0.0.2"))
@yurrriq
yurrriq / emacs.fish
Last active February 18, 2016 11:40
Fish functions for Emacs and Magit
function et -d 'Start an Emacs client in the terminal,
starting the server as necessary.'
emacsclient -cnw -a "" $argv
end
function ec -d 'Start an Emacs client in the Cocoa GUI,
starting the server as necessary.'
emacsclient -cna "" $argv
end
@yurrriq
yurrriq / docker-gsed.fish
Created November 25, 2015 20:45
Dockerized GNU sed
function sed
docker run --rm yurrriq/sed -v (PWD):/app
end
@yurrriq
yurrriq / edit-root.sh
Created December 24, 2015 06:47
Edit root commit
# http://stackoverflow.com/a/14630424/1793234
# As of Git version 1.7.12, you may now use
git rebase -i --root