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
brew install rbenv | |
brew install ruby-build | |
brew install rbenv-vars | |
brew install readline | |
brew install ctags | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile | |
exec $SHELL -i # reload the shell | |
CONFIGURE_OPTS="--disable-install-doc --with-readline-dir=$(brew --prefix readline)" rbenv install 1.9.3-p194 | |
rbenv global 1.9.3-p194 | |
gem install bundler rbenv-rehash git-up hitch gem-browse gem-ctags cheat awesome_print pry |
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
- flash.each do |name, msg| | |
%div{:class => "alert alert-#{name == :notice ? "success" : "error"}"} | |
%a.close{"data-dismiss" => "alert"} × | |
= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) |
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
require 'find' | |
files = {} | |
Find.find('.') do |f| | |
if(f != '.' && f != '..' && File.file?(f) && !f.include?('git')) | |
size = File.size(f) | |
if(size > 0) | |
files[f] = size | |
end | |
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
require 'rubygems' | |
require 'chilkat' | |
# Ruby script to list files and sub-directories on an FTP server. | |
ftp = Chilkat::CkFtp2.new() | |
success = ftp.UnlockComponent("anything for 30-day trial") | |
if not success | |
print "ftp component is locked!" | |
exit |
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
.arrow_box { | |
position: relative; | |
background: #000; | |
} | |
.arrow_box:after { | |
bottom: 100%; | |
border: solid transparent; | |
content: " "; | |
height: 0; | |
width: 0; |
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
# turn off | |
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist | |
# turn back on | |
sudo launchctl load -wF /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist |
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
sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /bin/subl |
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
## Install xcode 4 - App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) | |
## iTerm2 - http://www.iterm2.com/ | |
## Homebrew http://mxcl.github.com/homebrew/ | |
ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" | |
Note that Xcode is a pre-req for Homebrew | |
## Set shell to ZSH and install oh-my-zsh | |
brew install wget |
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
require 'benchmark' | |
ITERATIONS = 1000000 | |
Benchmark.bm(10) do |bench| | |
0.upto(40) do |n| | |
bench.report("chars: #{n}") do | |
string = "n"*n | |
ITERATIONS.times do | |
string + 'x' |
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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # | |
############ |
NewerOlder