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
{ | |
"_id": "_design/example", | |
"_rev": "8-9dfbf79df2f15317ef69e37e0a70a704", | |
"validate_doc_update": "function(newDoc,oldDoc,user) { | |
function require(prop, message) { | |
message = message || prop + 'is required' | |
if(!newDoc[prop]) throw({'forbidden': message }) | |
} | |
require('title') | |
require('body') |
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
div#content h2 img { | |
float: left; | |
margin-right: 3px; | |
} | |
div.comment { | |
min-height:94px; | |
padding-bottom: 10px !important; | |
} |
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 Enumerable = function() { | |
this.map = function(func, i, m) { | |
var idx = i || 0 | |
var mem = m || [] | |
if(this.length != idx) { | |
return this.map(func, idx+1, mem.concat(func(this[idx]))) | |
} else { | |
return mem | |
} | |
} |
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
If builds of PostgreSQL 9 are failing and you have version 8.x installed, | |
you may need to remove the previous version first. See: | |
https://github.com/mxcl/homebrew/issues/issue/2510 | |
To build plpython against a specific Python, set PYTHON prior to brewing: | |
PYTHON=/usr/local/bin/python brew install postgresql | |
See: | |
http://www.postgresql.org/docs/9.0/static/install-procedure.html | |
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
# keith.rb | |
class << Time | |
# The only two times of the day that matter to Keith! | |
def now | |
["Bounce 'o' clock", "Tuna 'o' clock"].sample | |
end | |
end | |
class String |
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
# by mark burns | |
brew install sl; echo "alias ls='sl'" >> ~/.bash_profile && source ~/.bash_profile |
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
// why this? | |
Array.prototype.slice.call(arguments, 1) | |
// when you can do this? | |
[].slice.call(arguments, 1) |
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 'net/https' | |
https = Net::HTTP.new('api.twilio.com', 443) | |
https.use_ssl = true | |
https.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
https.request_get('/') |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Response> | |
<Say>Thanks for calling</Say> | |
<Sms>Thanks for calling</Sms> | |
</Response> |
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
# using twilio-rb | |
Twilio::Call.create to: telephone_number_of_participant, from: your_caller_id, url: conference_resource_url |