View gist:8775541
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
-module(dumb_math). | |
-export([ | |
square/1 | |
]). | |
View gist:8775605
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
-module(dumb_math_tests). | |
-compile(export_all). | |
-include_lib("eunit/include/eunit.hrl"). | |
square_test_() -> | |
{ "Square tests", [ |
View gist:8775662
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
-module(dumb_math). | |
-export([ | |
square/1 | |
]). | |
View gist:8775865
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
-module(dumb_math_tests). | |
-compile(export_all). | |
-include_lib("proper/include/proper.hrl"). | |
-include_lib("eunit/include/eunit.hrl"). | |
prop_square_never_negative() -> |
View gist:9015456
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
<html><body> | |
<?php | |
// normally i'd write this more densely, but you said you wanted some exposure | |
// so i'm writing it in single concepts per line and annotating it for reference :) | |
// config |
View Eng10Trie.js
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 Eng10Trie = '0:4JH | |
1:4JM | |
2:4JO | |
3:4H5 | |
4:498 | |
5:4IP | |
6:4J1 | |
7:4J6 | |
8:4HN | |
9:4HU |
View levenshtein.js
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
function levenshtein (s, t) { | |
if (!s.length) { return t.length; } | |
if (!t.length) { return s.length; } | |
return Math.min( | |
levenshtein(s.substr(1), t) + 1, | |
levenshtein(t.substr(1), s) + 1, | |
levenshtein(s.substr(1), t.substr(1)) + (s[0] !== t[0] ? 1 : 0) | |
); |
View reporters.thanks
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
// spaces/tabs separate unless preceded with a comma, which makes list members, or surrounded by '', which makes js string notation | |
// first is operator; after that are expected-length varargs like irc | |
// 2nd argument to thanks is list of front of string matches for things raised by keyword report | |
View gist:9867401
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
upstring( [], Accumulator ) -> | |
lists:reverse(Accumulator); | |
upstring( [Letter | StringRemainder], Accumulator) -> |
View gist:11097913
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
receive | |
case -> | |
handler; | |
case -> | |
handler; | |
case -> | |
handler |
OlderNewer