- Preparation
Setup a local CocoaPods directory, and register it with CocoaPods
mkdir -p ~/CocoaPods/Local
(cd ~/CocoaPods/Local; git init)
pod repo add ~/CocoaPods/Local
- Update local CocoaPod
require "rubygems" | |
require "ruby2ruby" | |
require 'parse_tree' # gem ParseTree | |
#require 'ruby2ruby' | |
#require 'sexp_processor' | |
#require 'unified_ruby' | |
def Continuation.create(*args, &block) | |
cc = nil |
/* | |
* Save this file as "kvs.js". | |
* | |
* Usage: | |
* | |
* node kvs.js set foo bar | |
* | |
* ... sets the "foo" entry to bar, and overwrites the kvs.js script with the updated data. | |
* | |
* node kvs.js set foo bar |
$count = 1000000 | |
def bench0(&block) | |
r = Time.now | |
$count.times do end | |
Time.now - r | |
end | |
def bench1(&block) | |
r = Time.now | |
$count.times(&block) |
brew install dovecot | |
sudo dscl . -create /Users/_dovecot | |
sudo dscl . -create /Users/_dovecot UserShell /usr/bin/false | |
sudo dscl . -create /Users/_dovecot UniqueID 104 | |
sudo dscl . -create /Users/_dovecot PrimaryGroupID 104 | |
sudo dscl . -create /Users/_dovecot NFSHomeDirectory /var/empty | |
sudo dscl . -passwd /Users/_dovecot '' |
class File | |
class Fingerprint | |
attr_reader :inode | |
def initialize(path) | |
@path = path | |
@inode = File.stat(@path).ino rescue nil | |
end | |
def ==(other) |
class ActiveRecord::Associations::AssociationCollection | |
# Does the AssociationCollection contains entries? | |
def empty?(*args) | |
if fetch_first_or_last_using_find?(args) | |
if !args.last.is_a?(Hash) | |
args.push :select => "1" | |
elsif (!args.last[:select]) | |
args.last = { :select => "1" }.update(args.last) | |
end | |
module BetterObjectIdWarning | |
def self.activate | |
return if @activated | |
@activated = true | |
Object.class_eval { | |
def id | |
return object_id if @in_object_id_warning | |
@in_object_id_warning = true |
class ThinkingSphinx::FacetIdsSearch < ThinkingSphinx::FacetSearch | |
def initialize(*args) | |
options = args.extract_options! | |
@fast_facet_names = options.delete(:facets) || raise("Missing facet names") | |
@fast_facet_names = [ @fast_facet_names ].flatten.map(&:to_s) | |
args.push options | |
super *args | |
end | |
#!/usr/bin/env ruby | |
require "fileutils" | |
SCRIPT = File.basename(__FILE__) | |
DIR = File.expand_path File.dirname(__FILE__) | |
LOCAL_PODS = File.expand_path "~/CocoaPods/Local" | |
HEAD = `git log -1 --pretty=%H`.chomp | |
def git(*args) |
Setup a local CocoaPods directory, and register it with CocoaPods
mkdir -p ~/CocoaPods/Local
(cd ~/CocoaPods/Local; git init)
pod repo add ~/CocoaPods/Local