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 'rake/remote_task' | |
desc 'rsyncs ./ => remote:/tmp' | |
remote_task :should_work do | |
rsync('./', '/tmp') | |
end | |
desc 'rsyncs ./ => remote:/tmp' | |
remote_task :should_fail do |
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
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold |
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
<% ['item 1', 'item 2'].each do |item| %> | |
<li><%= item %></li> | |
<% end %> | |
<% 3.times do |ix| %> | |
<li><%= ix %></li> | |
<% end %> |
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
YELLOW='\[\e[1;33m\]' | |
BLUE='\[\e[1;36m\]' | |
RED='\[\e[1;31m\]' | |
WHITE='\[\e[1;37m\]' | |
NC='\[\033[00m\]' #'\e[0m' # No Color | |
function __tc_git_ps1 { | |
if [[ $(git rev-parse --show-cdup) == "" ]]; then | |
echo "${YELLOW}\$(__git_ps1 '(%s)')${NC}" | |
else |
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
lol = log --graph --oneline --decorate | |
lola = log --graph --oneline --decorate --all |
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
Gem::Specification.new do |s| | |
s.name = "sudo_attr_accessibility" | |
s.version = "0.2.0" | |
s.summary = "Make all attributes of an AR-model accessible to some roles" | |
s.files = ["sudo_attr_accessibility.rb"] | |
s.homepage = "https://gist.github.com/1443911" | |
s.license = "MIT" | |
s.author = "Gert Goet" | |
s.email = "[email protected]" | |
s.require_paths = ['.'] |
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
#! /usr/bin/env ruby | |
$VERBOSE=true | |
UNACCEPTABLE_REFNAME = /refs\/heads\/\d/ | |
refname, oldrev, newrev = ARGV[0...3] | |
if oldrev[/^0{40}/] # new branch received | |
if refname[UNACCEPTABLE_REFNAME] | |
raise "Names of branches can't be of the form '#{UNACCEPTABLE_REFNAME}'" | |
end |
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
## keybindings | |
unbind C-b | |
unbind C-a | |
unbind % | |
unbind , | |
unbind . | |
unbind n | |
unbind p | |
unbind [ | |
unbind '"' |
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
# Source: https://gist.github.com/neerajdotname/5187092 | |
#gem 'activerecord', '4.0.0.rc2' | |
gem 'activerecord', '3.2.13' | |
require 'active_record' | |
require "minitest/autorun" | |
require 'minitest/pride' | |
require 'logger' | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') |
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
# Usage: | |
# $ rails new blog -m https://gist.githubusercontent.com/eval/9410525/raw/template.rb | |
annotate_version = ask("What annotate version should I bundle? [2.6.2]") | |
gem 'annotate', annotate_version.presence || '2.6.2' | |
generate(:model, "person", "name:string") | |
inject_into_class 'app/models/person.rb', 'Person', " A = 1\n" | |
rake "db:migrate" |
OlderNewer