This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const emptyState = null; | |
// `var` in muKanren. | |
const v = c => Symbol(c); | |
// `var?` in muKanren. | |
const isVar = c => typeof c === 'symbol'; | |
const walk = (u, s) => { | |
if (s === null) { | |
return u; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am justinj on github. | |
* I am jaffray (https://keybase.io/jaffray) on keybase. | |
* I have a public key ASAbW8fwxoMLnG_Izquu3xSCGLg1F2ZFfR2vI7tR1qsU_Qo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns veyemel) | |
; ref http://www.cs.nott.ac.uk/~gmh/pearl.pdf | |
(defn return [v] | |
(fn [s] | |
[{:result v | |
:remaining s}])) | |
(def fail (fn [_] [])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var classifyToken = function(token) { | |
var kind; | |
if (token === "λ") { kind = LAMBDA; } | |
else if (token === ".") { kind = DOT; } | |
else if (token === "(") { kind = LPAREN; } | |
else if (token === ")") { kind = RPAREN; } | |
else { kind = IDENTIFIER; } | |
return { | |
kind: kind, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippet cc | |
React.createClass({ | |
${0} | |
}); | |
snippet cdm | |
componentDidMount: function(${1:rootNode}) { | |
${0} | |
}, | |
snippet cdu | |
componentDidUpdate: function(${1:prevProps}, ${2:prevState}, ${3:rootNode}) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" React Prop Text Object | |
" Requires https://github.com/kana/vim-textobj-user | |
" Given foo={bar} | |
" ar => |foo={bar}| | |
" ir => foo=|{bar}| | |
call textobj#user#plugin('reactprop', { | |
\ '-': { | |
\ 'select-a-function': 'ReactPropA', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "sinatra" | |
enable :inline_templates | |
def get_algs(input) | |
input | |
.lines | |
.map(&:chomp) | |
.reject(&:empty?) | |
.each_slice(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FFFFF..FF.FF | |
Failures: | |
1) Indenting single body functions inside do block is declared with fn syntax | |
Failure/Error: assert_correct_indenting <<-EOF | |
expected: "def do\n some_func = fn x -> x end\nend" | |
got: "def do\nsome_func = fn x -> x end\nend" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def valid_move_1?(scramble, move) | |
if scramble.empty? | |
true | |
elsif same_face?(scramble[-1], move) | |
false | |
elsif scramble.count == 1 | |
true | |
elsif same_axis?(scramble[-1], scramble[-2], move) | |
false | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_scramble | |
["R","U"].cycle.take(25).map { |m| m + ["","'","2"].sample }.join(" ") | |
end |