Skip to content

Instantly share code, notes, and snippets.

View unicornrainbow's full-sized avatar
💖
🎈Sharing codes 🔫🛍🛁📐🎉💉🕳🚬💎💰💳

Rashiki Grace unicornrainbow

💖
🎈Sharing codes 🔫🛍🛁📐🎉💉🕳🚬💎💰💳
  • Newstime
  • Daytona Beach, FL
View GitHub Profile
require "selenium"
require "test/unit"
class NewTest < Test::Unit::TestCase
def setup
@verification_errors = []
if $selenium
@selenium = $selenium
else
@selenium = Selenium::SeleniumDriver.new("localhost", 4444, "*chrome", "http://www.google.com/", 10000);
@unicornrainbow
unicornrainbow / gist:535717
Created August 18, 2010 18:27
Favorite Git Commands
# This is a list of my favorite git commands.
# Keep a clean history by rebasing when you pull.
git pull --rebase
# Short and sweet output for the most used git command.
git status -s
# One line output from git log is usually enough and gives you a better overall picture.
git log --oneline
# Function to start script server
s() {
if [[ $(rails -v) =~ 'Rails 2' ]]; then
script/server $*
else
rails server $*
fi
}
# Functions to start rails server, run generate open console
rails-server () {
if [ -e script/rails ]; then
rails server $*
elif [ -e script/server ]; then
./script/server $*
else
echo "Error: Not a rails app."
fi
}
rails () {
if [ -e script/server ]; then
script/"$@"
else
command rails "$@"
fi
}
@unicornrainbow
unicornrainbow / varnish-2.1.4-req.esis.patch
Created December 6, 2010 17:15
Add req.esis to vcl in varnish 2.1.4
diff --git a/bin/varnishd/cache_vrt.c b/bin/varnishd/cache_vrt.c
index dc855c9..48aa2ea 100644
--- a/bin/varnishd/cache_vrt.c
+++ b/bin/varnishd/cache_vrt.c
@@ -664,6 +664,15 @@ VRT_r_req_esi(struct sess *sp)
/*--------------------------------------------------------------------*/
int
+VRT_r_req_esis(const struct sess *sp)
+{
colorscheme delek
# Hide the toolbar.
if has("gui_running")
set guioptions=egmrt
endif
require 'fileutils'
move_to_dir = ARGV[0] || Time.now.year.to_s
puts <<usage
Project Archiver
======================================================================
Tell me what to do with each entry. Enter nothing to skip.
- Entries which you move will go to #{move_to_dir}.
@unicornrainbow
unicornrainbow / Projects.thor
Created January 6, 2011 17:29
Archive and junk old entres littering your directory.
class Projects < Thor
desc 'archive', 'Archive and junk old entres littering your directory.'
def archive(move_to_dir = Time.now.year.to_s)
Dir.foreach(Dir.pwd) do |entry|
unless entry =~ /^\.|^[\d]{4}|#{move_to_dir}/
case ask "#{entry} (move/junk) or skip: "
when /^m(ove)?$/
FileUtils.mv entry, move_to_dir
when /^j(unk)?$/
@unicornrainbow
unicornrainbow / gist:780553
Created January 15, 2011 00:16
A bash function which improves the textmate mate command by opening a project file if available.
# Description:
# Changes the functionality of `mate` and `mate .` to open
# a textmate project file named after the current directory if one
# exists.
#
# What advantages do project files have?
# - If the project is already open, the window will be reused rather then creating another
# one. This creates a presents a nice way to focus on the project from the command line.
# Just type mate (or mate . if your in the habit.)
# - Projects remember what files you had open last time so they're great for jumping back