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
eval( | |
(%w[ | |
1 0 | |
1 0 0 | |
]).zip(%w[ | |
o d | |
e v n | |
]).map{ |(to, fro)| | |
%Q{ | |
#{to}.upto(9) do |#{fro}| |
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
//The fun solution: using array methods | |
var ary = []; | |
for(var i = 1; i <= 1000; i++){ ary.push(i); } | |
console.log( | |
ary.filter(function(item){ | |
return (item % 3 == 0 || item % 5 == 0) | |
}).reduce(function(memo, current){ | |
return memo + current | |
}, 0) | |
); |
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> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<title>Brainfuck</title> | |
<script type="text/javascript" charset="utf-8"> | |
/* | |
Google HTML5 slides template | |
Authors: Luke Mahé (code) |
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
galea | |
galla | |
gamba | |
gamma | |
ganga | |
ganja | |
ganta | |
ganza | |
geira | |
gemma |
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 wrapped = function( obj ){ | |
this.self = obj; | |
}; | |
wrapped.prototype.maybe = function( prop ){ | |
return this.self.hasOwnProperty( prop ) ? this.self[prop] : this.self; | |
} | |
var _ = function( obj ){ | |
return new wrapped( obj ); |
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
sys = require("child_process"); | |
var Cat = function( name ){ | |
this.name = name; | |
}; | |
Cat.prototype.meow = function(){ | |
sys.exec('say "' + this.name + ' says MEEEEOOOOOOOOOWOWOWOW"'); | |
}; |
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
class hash: pass | |
hash.merge = lambda self, **b: dict(self.items() + b.items()) |
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
[:h1 "Hello world, etc."] | |
[:p | |
[:strong " this is the least"] | |
[:em " I "] | |
"could write"] |
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
sorted-map | |
;I have this stored in /usr/local/Cellar/clojure/1.3.0/.clj_completions | |
read-line | |
re-pattern | |
keyword? | |
unchecked-inc-int | |
val | |
chunked-seq? | |
find-protocol-impl | |
vector-of |
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
jQuery -> | |
for id, callback of Model.validations | |
[selector, event] = id.split("on") | |
$(selector).on(event, callback) | |
Model = | |
error_template: _.template( | |
'<span class="billing-error"><%= msg %></span>' | |
) |