This file contains hidden or 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
@implementation Connection | |
// … | |
static NSArray *requestHeaders; | |
+ (void)setRequestHeaders:(NSArray *)headers { | |
requestHeaders = headers; | |
} | |
+ (NSArray *)getRequestHeaders { |
This file contains hidden or 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
+ (Response *)get:(NSString *)url withUser:(NSString *)user andPassword:(NSString *)password { | |
NSMutableURLRequest *request = [NSMutableURLRequest requestWithUrl:[NSURL URLWithString:url] andMethod:@"GET"]; | |
return [self sendRequest:request withUser:user andPassword:password]; | |
} | |
// to: | |
+ (Response *)get:(NSString *)url withUser:(NSString *)user andPassword:(NSString *)password { | |
NSMutableURLRequest *request = [NSMutableURLRequest requestWithUrl:[NSURL URLWithString:url] andMethod:@"GET"]; | |
for (NSDictionary *header in requestHeaders) |
This file contains hidden or 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
NSDictionary *api_token_header = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"X-API-Token", @"MY API KEY", nil] forKeys:[NSArray arrayWithObjects:@"name", @"value", nil]]; | |
[Connection setRequestHeaders:[NSArray arrayWithObject:api_token_header]]; |
This file contains hidden or 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 'rubygems' | |
require 'curb' | |
require 'benchmark' | |
loop do | |
resp = nil | |
t = Benchmark.measure { | |
resp = Curl::Easy.perform(ARGV[0]) | |
} | |
puts "#{resp.response_code} : #{t}" |
This file contains hidden or 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
root 2127 0.0 0.2 2476 1112 ? Ss Oct20 0:00 /bin/sh /command/svscanboot | |
root 2129 0.0 0.0 1708 372 ? S Oct20 0:00 svscan /service | |
root 3603 0.0 0.0 1540 312 ? S 17:37 0:00 supervise foo | |
root 4238 0.0 0.2 2472 1064 ? S 17:47 0:00 /bin/sh ./run | |
root 4239 3.7 7.3 38596 33932 ? Sl 17:47 0:03 unicorn_rails master -E staging -c /home/www/foo/shared/config/unicorn.conf | |
will 4250 0.0 6.7 38468 31132 ? Sl 17:47 0:00 unicorn_rails worker[0] -E staging -c /home/www/foo/shared/config/unicorn.conf |
This file contains hidden or 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
namespace :deploy do | |
desc "Restart Application" | |
task :restart, :roles => :app do | |
sudo "kill -3 `cat #{shared_path}/pids/unicorn.pid`" | |
end | |
end |
This file contains hidden or 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
./makelib unix.a alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o \ | |
buffer_2.o buffer_get.o buffer_put.o buffer_read.o buffer_write.o \ | |
coe.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o \ | |
lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o \ | |
open_trunc.o open_write.o openreadclose.o pathexec_env.o \ | |
pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o \ | |
sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \ | |
stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \ | |
stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o \ | |
wait_pid.o |
This file contains hidden or 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
pinky:~ will$ defaults read com.atebits.tweetie-mac filterTerms | |
( | |
"#followfriday", | |
bkite, | |
"#dailygoals", | |
"4sq.com", | |
"gowal.la", | |
"#superbowl", | |
"Super Bowl", | |
superbowl, |
This file contains hidden or 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
"During times of universal deceit, telling the truth becomes a revolutionary act." - George Orwell |
This file contains hidden or 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 Status < ActiveRecord::Base | |
# Is there a build in way of doing this? | |
alias :original_to_json :to_json | |
def to_json(options = {}) | |
options[:except] = :created_at | |
original_to_json(options) | |
end | |
end |