{
"users": [{
"id": "1",
"name": "Guille",
"posts": { "href": "http://example/posts" },
"links": {
"posts": [1,2,3,4,5]
}
}]
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
#!/usr/bin/env bash | |
while true | |
do | |
num=$(ec2-describe-instances | grep running | wc -l | awk '{print $1}') | |
echo $num | |
[[ $num < 15 ]] && say yo yo yo yo yo yo yo yo | |
sleep 300 | |
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
// sample paging | |
{ | |
"collection" : | |
{ | |
"version" : "1.0", | |
"href" : URI, | |
"links" : [ | |
{"href" : "...", "rel" : "first"}, | |
{"href" : "...", "rel" : "previous"}, | |
{"href" : "...", "rel" : "next"}, |
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
"links" : [{"href": "http://first", "rel": "first"} ] | |
"links" : [{"first": {"href": "http://first"}} ] | |
"first_url": "http://first" | |
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
#define AppDelegate (MyAppDelegate *)[[UIApplication sharedApplication] delegate]; |
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 Jbuilder | |
def links! model, *args | |
args.each do |arg| | |
if model.reflections[arg].collection? | |
_set_value arg, model.send(arg).map(&:id) | |
else | |
_set_value arg, model.send(arg).id | |
end | |
end | |
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
#!/bin/bash | |
echo "Deploying radbot, yo" | |
GIT_WORK_TREE=/var/radbot git checkout -f | |
echo "Bundling like a boss" | |
cd /var/www/radbot && bundle update | |
echo "Restarting radbot" |
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
#!/bin/bash | |
cd /Users/csexton | |
# Rsync to Dreamhost | |
OPTIONS="-e ssh --relative --compress --archive --delete-excluded --progress --human-readable " | |
SERVER="backup.remote:cs-dewback" | |
rsync $OPTIONS Projects Pictures Documents $SERVER \ | |
--exclude="OmniFocus Backups" \ | |
--exclude="*vmwarevm" \ |
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 'rspec' | |
require 'rspec/autorun' | |
def pack_size(desc) | |
if (desc.match(/([\d]+)[\s]pack/i)) | |
$1.to_i | |
else | |
1 | |
end | |
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 pack_size(desc) | |
if (desc.match(/([\d]+)[\s]pack/i){ |m| pack_count = m[:pack_count].to_i } | |
$1.to_i | |
else | |
1 | |
end | |
end | |
def pack_size(desc) |
OlderNewer