View notifier.rb
response.docs.each_with_index do |doc, i| | |
attachments[doc.filename.to_s] = {:mime_type => doc.blob.content_type, :content => doc.blob.download } | |
end |
View stdin.sh
myvar=`cat` | |
echo "$myvar" |
View sqlformat.sh
#!/bin/bash | |
/usr/local/bin/sqlformat --keywords upper --reindent --identifiers lower - |
View .gitconfig
[diff] | |
external = /home/user/diff.py |
View options.coffee
// coffescript | |
(options...)-> | |
$.each options, (i, v)-> | |
console.log v |
View superkiller.js
function superkiller(o, prop_name) { | |
if(o.hasOwnProperty(prop_name)) { | |
delete o[prop_name] | |
} | |
$.each(x, function(i, e) { | |
if(typeof(e) == "object") { superkiller(e, prop_name) } | |
}); | |
} |
View escape.rb
h.simple_format h.h(object.text) |
View delegate_all.rb
def method_missing(method_name, *arguments, &block) | |
return target.send(method_name, *arguments, &block) if target.respond_to? method_name | |
super | |
end |
View boolean.rb
[true, false].reduce(&:&) | |
[true, false].reduce(&:|) | |
# the same | |
[true, false].any? |
View unique.coffee
if Array.prototype.unique == undefined | |
Array.prototype.unique = -> | |
filtered_array = [] | |
$.each this.sort(), (index, value)-> | |
filtered_array.push(value) if filtered_array.indexOf(value) == -1 | |
filtered_array | |
if Array.prototype.is_unique == undefined | |
Array.prototype.is_unique = -> | |
this.length == this.unique.length |
NewerOlder