Skip to content

Instantly share code, notes, and snippets.

@cquaker
cquaker / generateFreshOpenUDID
Last active August 29, 2015 14:02
generateFreshOpenUDID
// CMOpenUDID + (id)_generateFreshOpenUDID
id __cdecl +[CMOpenUDID _generateFreshOpenUDID](struct CMOpenUDID_meta *self, SEL a2)
{
void *currentDevice; // r0@1 MAPDST
void *systemVersion; // r0@1
void *idfv; // r0@2
id result; // r0@2
int v7; // r5@3
int v8; // r4@3
int v9; // r5@3
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
require 'net/http'
require 'uri'
require 'benchmark'
require 'rubygems'
require 'restclient'
require 'patron'
URL = 'http://localhost:5984/test/test'
url = URI.parse URL
req = Net::HTTP::Get.new(url.path)
#!/bin/sh
# Install ImageMagick on Snow Leopard: by kain, improved by mislav and samsoffes
# http://www.icoretech.org/2009/08/install-imagemagick-in-leopard-snow-leopard/
# Work with 64bit kernel mode
set -e
PREFIX=/usr/local
# Passenger users: amend your Apache global configuration with the following directive
# SetEnv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/ruby
$LOAD_PATH &lt;&lt; "#{ENV["TM_SUPPORT_PATH"]}/lib"
require 'ui'
@cquaker
cquaker / httpdump
Created April 4, 2009 01:18 — forked from peterc/httpdump
# Monitor HTTP requests being made from your machine with a one-liner..
# Replace "en1" below with your network interface's name (usually en0 or en1)
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"
# OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile:
# (again replace "en1" with correct network interface name)
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*""
# All the above tested only on OS X.
# this goes in the $HOME dir
# needs mislav-rspactor v0.3.2 and RSpec 1.2
Rspactor::Runner.class_eval do
class << self
alias old_formatter_opts formatter_opts
def formatter_opts
# update this path to where you saved unicode_formatter.rb
old_formatter_opts + " -r /Users/mislav/Projects/unicode_formatter -f UnicodeFormatter"
end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/ruby
$LOAD_PATH &lt;&lt; "#{ENV["TM_SUPPORT_PATH"]}/lib"
require 'ui'
#!/usr/bin/env ruby
#
# usage: script/server_restarter
#
# Rails autoloading, while nice in theory, frequently doesn't work. Since Rails 2.3+
# is so fast when completely reloading the server, I wrote this script to listen to the
# given directories, and kill/restart the server when any file is changed.
#
# It's quick, simple, and it reliably reloads your application when changes are made.
#
#!/bin/sh
mkdir -p /usr/local/src && cd /usr/local/src
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.bz2
tar -xjvf ruby-1.9.1-p0.tar.bz2
cd ruby-1.9.1-p0
./configure --prefix=/usr --program-suffix=19 --enable-shared
make && make install