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
# Migrate SMS from iPhone to Android in OSX # | |
Parts of this taken from http://pastebin.com/d4hNUmTK | |
1. Make an unencrypted backup of your iPhone to iTunes, not using iCloud. | |
2. cd /tmp | |
3. put iphone_sms_* here (found below) | |
4. Find your ~/Library/Application Support/MobileSync/Backup/*/3d0d7e5fb2ce288813306e4d4636395e047a3d28(.mddata) | |
5. | |
> sqlite3 ~/Library/Application Support/MobileSync/Backup/(id)/3d0d7e5fb2ce288813306e4d4636395e047a3d28(.mddata) |
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
task :workers => :environment do | |
module Delayed | |
class Worker | |
def name_with_thread_id(*a, &b) | |
name_without_thread_id(*a, &b) + " thread:#{Thread.current.object_id}" | |
end | |
alias_method_chain :name, :thread_id | |
end | |
end | |
Rails.logger.info "Running threaded worker env." |
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 | |
// Create our client object. | |
$client= new GearmanClient(); | |
// Add default server (app.gearmanhq.com). | |
$client->addServer('hydra.gearmanhq.com', 4745); | |
//$client->addServer('localhost', 4731); | |
//$client->addServer('gm00.gearmanhq.net', 4745); | |
echo "Sending job...\n"; |
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 Progress | |
SECOND = 1 | |
MINUTE = SECOND * 60 | |
HOUR = MINUTE * 60 | |
DAY = HOUR * 24 | |
CONV = [DAY, HOUR, MINUTE, SECOND] | |
NAMES = %w(days hours minutes seconds) | |
attr_accessor :total, :current |
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
gem 'sinatra' |
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
%%{ | |
machine gearman; | |
alphtype int; | |
action req_magic { | |
puts "req_magic" | |
} | |
action get_size { |
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
-- control frame ---------- | |
c:0005 p:---- s:0016 b:0016 l:000015 d:000015 CFUNC :puts | |
c:0004 p:---- s:0014 b:0014 l:000013 d:000013 CFUNC :puts | |
c:0003 p:0100 s:0010 b:0010 l:001a78 d:001658 EVAL http_0mq.rb:13 | |
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH | |
c:0001 p:0000 s:0002 b:0002 l:001a78 d:001a78 TOP | |
--------------------------- | |
-- control frame ---------- | |
c:0011 p:---- s:0051 b:0051 l:000050 d:000050 CFUNC :undefine_finalizer | |
c:0010 p:---- s:0030 b:0030 l:000029 d:000029 CFUNC :free |
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
# ruby -v => ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin10] | |
RUBY_ENGINE = 'ruby' | |
require 'rubygems' | |
gem 'ffi-rzmq' | |
gem 'json' | |
require 'ffi-rzmq' | |
require 'json' | |
require 'request' | |
CTX = ZMQ::Context.new(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
# Override http debugging, pipe to STDERR. | |
# Output: | |
# <- "POST /watched.xml HTTP/1.1\r\nAccept: */*\r\nConnection: close\r\nContent-Type: application/xml\r\nAuthorization: Basic MzkyZih7219fIUH\r\nContent-Length: 82\r\nHost: xxxxxxxxxxx.com\r\n\r\n" | |
# <- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n" | |
# -> "HTTP/1.1 422 Unprocessable Entity\r\n" | |
module ActiveResource | |
class Connection | |
def http | |
http = Net::HTTP.new(@site.host, @site.port) | |
http.use_ssl = @site.is_a?(URI::HTTPS) |
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
>> /^\s*$/.match("one\r\n\r\ntwo") | |
=> #<MatchData "\r"> |