Skip to content

Instantly share code, notes, and snippets.

View thisivan's full-sized avatar

Ivan Torres thisivan

View GitHub Profile
# RVM bootstrap
$:.unshift(File.expand_path("~/.rvm/lib"))
require 'rvm/capistrano'
set :rvm_ruby_string, '1.8.7'
# main details
set :application, "fctableros"
role :web, "your_web_server_ip_or_domain"
role :app, "your_app_server_ip_or_domain"
role :db, "your_db_server_ip_or_domain", :primary => true
require "autotest/growl" # only for Mac
require "autotest/fsevent" # only for Mac
require "autotest/restart" # restart autotest when this file changes
# Don't reset terminal when finished test
Autotest::Growl::clear_terminal = false # only for Mac
Autotest.add_hook :initialize do |autotest|
# Ignore the following files
require "autotest/growl" # only for Mac
require "autotest/fsevent" # only for Mac
require "autotest/restart" # restart autotest when this file changes
# Don't reset terminal when finished test
Autotest::Growl::clear_terminal = false # only for Mac
Autotest.add_hook :initialize do |autotest|
# Ignore the following files
@thisivan
thisivan / rest_calc.js
Created November 4, 2010 17:13
The code from the talk I gave today about Node.js
/*
* Rest Calculator Server
*
* Based on "Building a Simple Web Service" screencast
* from thinkvitamin.com
*/
var util = require('util'),
http = require('http');
@thisivan
thisivan / .zshrc
Created February 11, 2011 22:07
Enable Vim mode in ZSH
# Enable Vim mode in ZSH
bindkey -v
autoload -U edit-command-line
zle -N edit-command-line
bindkey '^E' edit-command-line # Opens Vim to edit current command line
bindkey '^R' history-incremental-search-backward # Perform backward search in command line history
bindkey '^S' history-incremental-search-forward # Perform forward search in command line history
bindkey '^P' history-search-backward # Go back/search in history (autocomplete)
bindkey '^N' history-search-forward # Go forward/search in history (autocomplete)
@thisivan
thisivan / gist:823572
Created February 12, 2011 07:05
Concentrate (http://getconcentrating.com) Pomodoro AppleScripts
(* Setup this script to run when a "Pomodoro" activity has finished. It will start either "Pomodoro Break" or "Pomodoro Long Break" when finished *)
set activity1 to "Pomodoro Break"
set activity2 to "Pomodoro Long Break"
set button3 to "Stop Working"
set dialogText to "What do you want to do now?"
set dialogTitle to "Choose your next step..."
@thisivan
thisivan / .screenrc
Created February 14, 2011 05:47
My GNU Screen configuration file
term "screen-256color"
defscrollback 10000
bind y eval "writebuf" "exec sh -c 'pbcopy < /tmp/screen-exchange'"
@thisivan
thisivan / environment.rb
Created May 6, 2011 19:35
Take the abbreviated commit hash as the RAILS_ASSET_ID value
ENV['RAILS_ASSET_ID'] = `git log -1 --pretty=format:"%h"`
@thisivan
thisivan / method_missing_vs_method_compilation.rb
Created August 24, 2011 09:19
Method Missing vs Method Compilation
require 'benchmark'
# Defined method
class ExampleA
def test
10000 * 10000
end
end
# Method lookup
@thisivan
thisivan / gist:1201342
Created September 7, 2011 18:36
Install Ubuntu 11.04 Desktop (amd64)
# Update to the latest version
sudo apt-get update && sudo apt-get upgrade && sudo shutdown -r now
# Install Chromium
sudo apt-add-repository ppa:chromium-daily/dev
sudo apt-get update && sudo apt-get install chromium-browser
# Install basic tools
sudo apt-get install build-essential vim-nox curl git-core subversion openssh-server