Skip to content

Instantly share code, notes, and snippets.

View rupakg's full-sized avatar
😎
drinking from the firehose...

Rupak Ganguly rupakg

😎
drinking from the firehose...
View GitHub Profile
@pengwynn
pengwynn / random_voice_abc.rb
Created August 25, 2011 21:57
First grade fun learning Ruby
voices = %w(Agnes Kathy Princess Vicki Victoria)
("a".."z").each do |letter|
`say -v #{voices.shuffle.first} "#{letter}"`
end
require "thread"
$mutex = Mutex.new
$total = 0
def incr
$mutex.synchronize { $total += 1 }
sleep
end
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@rupakg
rupakg / Gemfile
Created November 12, 2011 08:14 — forked from therealadam/Gemfile
An example of how to authorize your app with Punchtab's OAuth2 API
source :rubygems
gem 'sinatra', '1.0'
gem 'oauth2'
gem 'json'
group :development do
gem 'shotgun'
end

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@steveclarke
steveclarke / capybara.md
Created April 10, 2012 17:32
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)
@tkarpinski
tkarpinski / github_issues_to_csv.rb
Created April 12, 2012 18:09 — forked from henare/github_issues_to_csv.rb
Exports Github issues to CSV (API v3)
require 'octokit'
require 'csv'
require 'date'
# Github credentials to access your private project
USERNAME="USER_NAME"
PASSWORD="SEKRIT"
# Project you want to export issues from
USER="REPO_OWNER"
PROJECT="REPO_NAME"
@wycats
wycats / analysis.md
Created May 1, 2012 23:20
otool -L results on Tokaido vs. rvm1 Ruby

One goal of Tokaido is to reduce the external dependencies of the precompiled Ruby.

There are several parts of the Ruby standard library that are normally linked against dylibs in your system. One such example is OpenSSL. To reduce external dependencies and the possibility of future failure (for example, if Apple removes OpenSSL from a future release), we would like to statically link these precompiled parts of the standard library instead of dynamically linking.

Also worth noting: psych depends on libyaml, which doesn't come with OSX to begin with. We do not want to rely upon libyaml existing in the system in order to use the precompiled Ruby, so we statically compile libyaml into psych.

In the output below, you can see that Tokaido compiled Ruby has dependencies only on libSystem and libobjc, which are extremely stable OSX libraries, and not on libruby, libssl or libcrypto. Instead, those libraries are statically compiled into openssl.bundle. This increases the portability of the prec