Skip to content

Instantly share code, notes, and snippets.

View sunaku's full-sized avatar

Suraj N. Kurapati sunaku

View GitHub Profile
@thinkerbot
thinkerbot / gem_env.sh
Created November 8, 2010 18:28
Illustrates GEM_HOME vs GEM_PATH
# Two ENV variables control the 'gem' command:
#
# GEM_HOME: the single path to a gem dir where gems are installed
# GEM_PATH: a standard PATH to gem dirs where gems are found
#
# A gem directory is a directory that holds gems. The 'gem' command will lay
# out and utilize the following structure:
#
# bin # installed bin scripts
# cache # .gem files ex: cache/gem_name.gem
@ahx
ahx / integration_test.rb
Created November 12, 2010 16:21
gaming_test.rb
# Example of how you can to use Capybara with plain Rails' integration tests and FactoryGirl (or plain MyModel.create…)
require 'test_helper'
require 'capybara'
require 'capybara/dsl'
require 'database_cleaner'
Capybara.app = Pardy::Application
Capybara.default_driver = :rack_test
DatabaseCleaner.strategy = :truncation
@weakish
weakish / README.markdown
Created February 3, 2011 15:33
warn about #weasel words in #writing
@andyl
andyl / ctags_vim_paths_gemfile.rb
Created February 18, 2011 19:08
Generates Ctags and Vim Paths from Gemfile.lock
#!/usr/bin/ruby
require 'rubygems'
require 'bundler'
=begin
This script was written to incorporate Bundler and Gemfile.lock into
Vim's tag and file-finding tools.
=end
# This code generates ctags. If a Gemfile.lock is found
@potch
potch / gist_line_numbers.css
Created September 26, 2011 18:53
CSS to add line numbers to embedded gists
.gist-highlight {
border-left: 3ex solid #eee;
position: relative;
}
.gist-highlight pre {
counter-reset: linenumbers;
}
.gist-highlight pre div:before {
@ilpeste
ilpeste / changes.sh
Created October 25, 2011 10:50
Errors while installing ruby-oci8 on Ubuntu 11.10
# Natty (Ubuntu 11.04)
$ dpkg -L libc6-dev | grep /types.h
/usr/include/bits/types.h
/usr/include/rpc/types.h
/usr/include/sys/types.h
# Oneiric (Ubuntu 11.10)
$ dpkg -L libc6-dev | grep /types.h
@sethbro
sethbro / test_helper.rb
Created January 13, 2012 18:19
MiniTest::Spec with Rails setup
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/autorun'
require 'minitest/pride'
require 'capybara/rails'
class MiniTest::Spec
include ActiveSupport::Testing::SetupAndTeardown
@darcyparker
darcyparker / vimModeStateDiagram.svg
Last active April 25, 2024 17:28
Vim Modes Transition Diagram in SVG https://rawgithub.com/darcyparker/1886716/raw/eab57dfe784f016085251771d65a75a471ca22d4/vimModeStateDiagram.svg Note, most of the nodes in this graph have clickable hyperlinks to documentation.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richo
richo / openbox_divvy.xml
Created February 29, 2012 22:03
Bindings to make window management simple in openbox
<keybind key="W-Escape">
<keybind key="q">
<action name="Close"/>
</keybind>
<!-- Keybindings for resizing, ala divvy -->
<!-- 30% -->
<keybind key="C-h">
<action name="MoveResizeTo">
<x>0</x>
<height>98%</height>
@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".