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
NSString *timestampAsStringFromEpochTime = [[NSNumber numberWithDouble:[[NSDate date] timeIntervalSince1970]] |
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/perl -w | |
#origin: http://pastie.textmate.org/89891 | |
use strict; | |
# This file clumsily extracts the DB's hidden in the iPhone backup files | |
# Usage: perl -w bkupextract.pl /Users/flip/Library/Application\ Support/MobileSync/Backup/*/* |
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 'rubygems' | |
require 'savon' | |
Savon.configure do |config| | |
config.log_level = :debug | |
end | |
client = Savon::Client.new do | |
wsdl.endpoint = "http://www.webservicex.net/globalweather.asmx" |
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
# in padrino 0.9.15 it not able to get params[username] in before filter. | |
before do | |
logger.debug "before" | |
logger.debug params | |
logger.debug params[:username] # empty in 0.9.15 but works in 0.9.14 | |
logger.debug "request" | |
logger.debug request.params | |
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
~/projects/jruby ➔ jirb | |
irb(main):001:0> require 'java' | |
=> true | |
irb(main):002:0> import com.sun.tools.attach.VirtualMachine | |
=> Java::ComSunToolsAttach::VirtualMachine | |
irb(main):003:0> vm = VirtualMachine.attach($$.to_s) | |
=> sun.tools.attach.MacosxAttachProvider@47875da7: 3294 | |
irb(main):004:0> histo = vm.heap_histo([].to_java).to_io | |
=> #<IO:0x32b95f72> | |
irb(main):005:0> histo.lines.first(25).each {|line| puts line}; nil |