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
# Path to your oh-my-zsh configuration. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
export ZSH_THEME="prose" | |
# Set to this to use case-sensitive completion |
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
if [ "x$OH_MY_ZSH_HG" = "x" ]; then | |
OH_MY_ZSH_HG="hg" | |
fi | |
function virtualenv_info { | |
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' | |
} | |
function hg_prompt_info { | |
$OH_MY_ZSH_HG prompt --angle-brackets "\ |
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
# extracted from http://www.thekua.com/atwork/2011/07/ruby-script-to-capture-http-traffic/ | |
require 'webrick' | |
include WEBrick | |
class Simple < WEBrick::HTTPServlet::AbstractServlet | |
def do_POST(request, response) | |
puts "Body: " + request.body | |
puts "Header: " + request.raw_header.to_s | |
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
#add to .zshrc | |
bindkey "^[[3~" delete-char | |
bindkey "^[3;5~" delete-char |
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
# connected as sys | |
SELECT * FROM V$SESSION WHERE USERNAME LIKE 'CODEIT_BRIANSTORTI' | |
ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE; |
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
ALTER USER <<USERNAME>> ACCOUNT UNLOCK |
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 dd if=/dev/zero of=/swapfile bs=1M count=2048 | |
sudo mkswap /swapfile | |
gksu gedit /etc/fstab | |
add to the end: | |
/swapfile none swap sw 0 0 | |
reboot |
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 'spreadsheet' | |
Spreadsheet.client_encoding = 'UTF-8' | |
TEST_FILE = "test.xls" | |
MODIFIED_FILE = "modified.xls" | |
def inspect_sheet sheet | |
sheet.each do |row| | |
if row[1].is_a? Spreadsheet::Formula |
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
# Just drop this code in lib/tasks/deploy.rake and now a simple '$ rake deploy' will push your changes live. | |
require 'net/ssh' | |
desc "Deploy site to production" | |
task :deploy => :environment do | |
host = 'yourhost.com' | |
user = 'username' | |
options = {:keys => '~/.ssh/keys/yourserver.pem'} | |
remote_path = '/path/to/rails_app' |
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 'spreadsheet' | |
TEMPLATE = "template.xls" | |
LOCAL_FILE_NAME = "generated.txt" | |
Spreadsheet.client_encoding = 'UTF-8' | |
def inspect_sheet sheet | |
File.open(LOCAL_FILE_NAME, 'w') {|f| |