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
. | |
.vir. d$b | |
.d$$$$$$b. .cd$$b. .d$$b. d$$$$$$$$$$$b .d$$b. .d$$b. | |
$$$$( )$$$b d$$$()$$$. d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b. .$$$$$$$b. | |
Q$$$$$$$$$$B$$$$$$$$P" d$$$PQ$$$$b. $$$$. .$$$P' `$$$ .$$$P' `$$$ | |
"$$$$$$$P Q$$$$$$$b d$$$P Q$$$$b $$$$b $$$$b..d$$$ $$$$b..d$$$ | |
d$$$$$$P" "$$$$$$$$ Q$$$ Q$$$$ $$$$$ `Q$$$$$$$P `Q$$$$$$$P | |
$$$$$$$P `""""" "" "" Q$$$P "Q$$$P" "Q$$$P" | |
`Q$$P" """ |
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
set_trace_func proc { |event, file, line, id, binding, classname| | |
#cpu = `ps auxfh | grep #{$$} | grep -v tracer | grep -v grep | awk '{print $3}'`.strip | |
fid ||= File.open("/tmp/tracer.#{$$}", 'a+') | |
fid.puts "[%s][%s] %8s %s:%-2d %10s %8s\n" % [Time.now, '', event, file, line, id, classname] if file.match(/srv/) && !file.match(/vendor\/|usr\/local\/lib/) | |
} |
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
/* Sort Example */ | |
NSSortDescriptor *sortDescriptor; | |
sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"createdAt" | |
ascending:NO] autorelease]; | |
NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor]; | |
NSArray *sortedArray = [eventArray sortedArrayUsingDescriptors:sortDescriptors]; | |
_events = [[NSMutableArray alloc] initWithArray:sortedArray]; |
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
Walter White's gotta push that blue | |
Til there ain't shit but red to do | |
That's no ice cream or a picnic | |
He's firecrackin' you're on the hitlist | |
Dexter's lost, to step to Albuquerque | |
I'm like the smoke monster, no way to merk me | |
What's your men so mad about Mr. Draper? | |
Yo got two Emmy's now, ain't that a caper? | |
Doctor's got his house, but now he's in mine |
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
#!/usr/bin/env ruby | |
# http://hboon.com/speeding-up-itunes-iphone-synchronization/ | |
# defaults write com.apple.iTunes DeviceBackupsDisabled -bool true | |
# To re-enable backup: | |
# defaults write com.apple.iTunes DeviceBackupsDisabled -bool false | |
case ARGV[0] | |
when /on|true|1/i | |
`defaults write com.apple.iTunes DeviceBackupsDisabled -bool true` | |
puts "CAUTION: Disabling iTunes Backups!" |
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
// Detach to update the UI, example takes a BOOL argument | |
[NSThread detachNewThreadSelector:@selector(setIsWaiting:) | |
toTarget:self | |
withObject:[NSNumber numberWithBool:YES]]; |
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
var days = Math.floor((new Date(2011,9,26) - new Date()) / 1000 / 60 / 60 / 24); | |
var sprints = days / 14.0 | |
"There are " + days + " days left until 10/26 (" + sprints + " 2-week sprints)"; |
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
# http://blog.jayfields.com/2007/11/ruby-testing-private-methods.html | |
require 'rubygems' | |
require 'dust' | |
require 'test/unit' | |
class Ninja | |
private | |
def kill(num_victims) | |
"#{num_victims} victims are no longer with us." |
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
#!/bin/bash | |
# http://archives.postgresql.org/pgsql-admin/2010-05/msg00285.php | |
# Output lines suitable for sysctl configuration based | |
# on total amount of RAM on the system. The output | |
# will allow up to 50% of physical memory to be allocated | |
# into shared memory. | |
# On Linux, you can use it as follows (as root): | |
# | |
# ./shmsetup >> /etc/sysctl.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
Timeout::timeout(@timeout) do | |
sleep 2 while rack_node.refresh && rack_node.status != 'ACTIVE' | |
sleep 2 while !(TCPSocket.new(rack_node.addresses[:public].first, 22) rescue nil) | |
end |