This file contains hidden or 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
# ./configure --prefix=/usr/local/Cellar/ffmpeg/0.9.1 --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-libfreetype --cc=/usr/bin/clang --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid --disable-ffplay | |
ACODEC_TESTS='ac3_fixed_test | |
adpcm_ima_qt_test | |
adpcm_ima_wav_test | |
adpcm_ms_test | |
adpcm_swf_test | |
adpcm_yam_test | |
alac_test | |
aref_test | |
flac_test |
This file contains hidden or 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 HashWithIndifferentAccess < Hash | |
def to_hash_recursive | |
result = self.to_hash | |
result.each do |key, value| | |
if(value.is_a? HashWithIndifferentAccess) | |
result[key] = value.to_hash_recursive | |
end | |
end |
This file contains hidden or 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
namespace :compass do | |
desc 'Compile SCSS to CSS' | |
task :compile do | |
old_argv = ARGV | |
ARGV = [] | |
load Gem.bin_path('compass', 'compass', ">=0") | |
ARGV = old_argv | |
end |
This file contains hidden or 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
# By default ReGex will match the bigest occurrence: | |
ruby-1.9.2-p180 > "_one_ two _three_".scan(/_(.+)_/) | |
=> [["one_ two _three"]] | |
# But we can tell it to match all the smallest ones: | |
ruby-1.9.2-p180 > "_one_ two _three_".scan(/_(.+?)_/) | |
=> [["one"], ["three"]] |
This file contains hidden or 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
# use: | |
# ruby log_processor.rb log/production.log | |
# | |
# result: | |
# [ 168] /folders/xxx1.vitreous.co/fill_it | |
# [1816] /folders/xxx2.vitreous.co/auth | |
# [1230] /folders/xxx2.vitreous.co/auth_confirm?uid=1488231&oauth_token=myusjr3gg59ntdi | |
# [ 763] /folders/xxx2.vitreous.co/create_scaffold_form | |
# [ -] /folders/xxx2.vitreous.co/create_scaffold | |
# [ -] /folders/xxx2.vitreous.co/create_scaffold |
This file contains hidden or 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 Dropbox | |
class Entry | |
def recursive_hash | |
return metadata.hash unless metadata.is_dir | |
recursive_hashes = | |
list.select{ |e| e.is_dir }.map do |e| | |
@session.entry( e.path ).recursive_hash | |
end | |
This file contains hidden or 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
00 01 * * * /bin/bash --login -c 'cd <your app> && RAILS_ENV=production /usr/bin/env bundle exec rake <your rake>' >> /var/log/<your app>.log 2>&1 |
This file contains hidden or 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
# Wanting to use the _filter_ feature of _Liquid_ in _Mustache_?, no problem: | |
# To MarkDown filter in Mustache | |
require 'rubygems' | |
require 'mustache' | |
require 'rdiscount' | |
class MyView < Mustache | |
def to_md( text ) | |
RDiscount.new( text ).to_html |
This file contains hidden or 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
begin | |
require 's3' | |
rescue LoadError | |
require 'rubygems' | |
require 's3' | |
end |
This file contains hidden or 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
MAP01, Steps: 8 | |
--------- | |
| #| | |
| * *.| | |
| .| | |
| ....| | |
----U---- | |
MAP02, Steps: 17 | |
------------- |