🤷♀️
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
for ruby in ~/.rbenv/versions/*; do | |
rbenv uninstall -f ${ruby##*/} | |
rbenv install ${ruby##*/} | |
done |
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 cleanNumberValue(value) { | |
s = value.replace("'", '', 'g').replace(',', '.'); | |
return +(parseFloat(parseInt(s, 10)) * 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
"There he goes. One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die." |
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
<?php | |
#### configuration #### | |
$email = 'YOUR_EMAIL_ADDRESS'; | |
$token = 'YOUR_API_TOKEN'; | |
$hostName = 'all'; // use 'all' if you want to update all hosts | |
#### cURL request below #### | |
$json_data = json_encode(array( |
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
/** | |
* Play around with the numbers and the method names! | |
* | |
* For example: use counterClockwise and see what happens | |
*/ | |
var arDrone = require('ar-drone'); | |
var client = arDrone.createClient(); | |
client.takeoff(); |
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
// note: this does not work for nested objects | |
var toQueryString = function(obj) { | |
return Object.keys(obj).map(function(key) { | |
return key + '=' + obj[key]; | |
}).join('&'); | |
}; | |
toQueryString({}); // returns '' | |
toQueryString({foo: 'bar'}); // returns 'foo=bar' | |
toQueryString({billable: true, locked: false}); // returns 'billable=true&locked=false' |
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
tell application "Spotify" | |
return player position | |
end tell | |
-- returns 13.37 | |
tell application "Spotify" | |
return "" & player position | |
end tell |
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
store_template: &store_template | |
store: | |
robot: '/s3/store' | |
key: 'YOUR_AWS_KEY' | |
secret: 'YOUR_AWS_SECRET' | |
bucket: 'YOUR_S3_BUCKET' | |
production: | |
auth: | |
key: 'YOUR_KEY' |
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 RUBY_VERSION < '1.9' | |
# monkey patching open struct to allow overwriting id method | |
OpenStruct.__send__(:define_method, :id) { @table[:id] } | |
end |
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 throw_exception | |
raise "This is an exception" | |
rescue => e | |
puts e.message | |
end | |
throw_exception # output: "This is an exception" |