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
module MixinSample | |
def self.included(recipient) | |
recipient.extend(ClassMethods) | |
recipient.class_eval do | |
include InstanceMethods | |
end | |
end | |
module InstanceMethods | |
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
rvm use 1.9.3@your_project_name --create |
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
sh update-bundles.sh |
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
bundle exec ruby config/environment.rb |
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
# Update Homebrew so that /usr/local is converted to a git repository: | |
brew update | |
# Find for the specific revision that you need: | |
git log -S '0.9.9' Library/Formula/sphinx.rb | |
# Checkout the formula for that specific revision: | |
git checkout f4a925da5aee87cf7e2509116a495779a1af64b8 Library/Formula/sphinx.rb | |
# Install the desired version: |
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/env sh | |
for f in `find app/views/ -name "*.erb"` | |
do | |
echo "processing $f" | |
out=`echo $f | sed "s/\.erb$/\.haml/"` | |
html2haml $f > $out | |
git add $out | |
git rm $f | |
done |
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/env ruby | |
n = 2..1000 | |
o = [] | |
p = [] | |
for i in n | |
next if o.include? i | |
ii = i * 2 | |
while ii <= n.last do |
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
# Benchmarking .each and .map functions from jQuery and Underscore.js | |
# | |
# Requirements: | |
# npm install benchmark jquery underscore | |
Benchmark = new require('benchmark') | |
$ = require 'jQuery' | |
_ = require 'underscore' |
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
git status | grep deleted | cut -f2 | sed -e 's/deleted:\s*//g' | xargs git rm -f |
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
# convert private key to PEM (removing password) | |
openssl pkcs8 -inform DER -in FOC080926i89_1104071356s.key -outform PEM -out FOC080926i89_1104071356s.pem | |
# extract public key | |
openssl rsa -in FOC080926i89_1104071356s.pem -pubout -out FOC080926i89_1104071356s.pub.pem |
OlderNewer