- Use
CONTRIBUTING.md
for github to show a link when creating a pull request - http://tom.preston-werner.com/2010/08/23/readme-driven-development.html
git checkout -
to switch to previous branch (that way you can switch between 2 branches forth and back)- The first commit of a repo, as the first commit cannot be rebased later:
git commit -m "init repo" --allow-empty
git status -sb
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
# spec/support/rake.rb | |
require 'rake' | |
module Rake::TestHelpers | |
def run_task(name=subject) | |
Rake::Task[name].reenable | |
Rake.application.invoke_task name | |
end | |
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
# spec/support/database_cleaner.rb | |
# inspired by this article http://devblog.avdi.org/2012/08/31/configuring-database_cleaner-with-rails-rspec-capybara-and-selenium/ | |
# and later edited according to thoughtbot/suspenders setup (truncation => deletion) | |
RSpec.configure do |config| | |
config.before(:suite) do | |
DatabaseCleaner.clean_with(:deletion) | |
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
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
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
# vi: syn=sh : | |
from ubuntu:12.04 | |
run echo "deb http://archive.ubuntu.com/ubuntu precise main universe multiverse" > /etc/apt/sources.list | |
run echo "deb http://archive.canonical.com/ precise partner" >> /etc/apt/sources.list | |
run apt-get -qqyy update | |
run apt-get install -qqyy x11vnc xvfb skype pulseaudio pavucontrol openssh-server |
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
# smart pane switching with awareness of vim splits | |
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L" | |
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D" | |
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U" | |
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R" | |
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l" |
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
target/john: error while loading shared libraries: libgenerator-e170cac01c08bdc6.so: cannot open shared object file: No such file or directory |
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
// Use these lines in your root crate source code | |
#![deny(missing_docs)] | |
#![deny(warnings)] | |
// This stuff really works. It adds +50 to karma. | |
// And frequency of trains being delayed when you want to get | |
// somewhere in hurry really drops :) |
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
// Clone - for cloning non-owned resources to | |
// make actions that require ownership | |
// over them | |
// Show - if you ever want to log the value of | |
// this enum | |
// Send - if you ever want to send it over | |
// channel to a different task | |
// PartialEq - if you want to check if two instances | |
// of this enum are the same |
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 'rspec' | |
module StructDsl | |
def with_attributes(*args) | |
include Enumerable | |
args.map!(&:to_sym) | |
args.freeze | |
args.each { |p| attr_accessor p } |