Note: This is still in the workings. If you have anything you want to see added into this document please leave some feedback in the comment section below; or mail me at kuroir at gmail dot com
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
# get the name of the currently checked out tag | |
git describe --tags --abbrev=0 | |
# list all branches (local and remote) | |
git branch -a | |
# list all tags | |
git tag | |
# delete a tag |
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
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
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
class Object | |
def metaclass | |
class << self; self; end | |
end | |
def self.stub_method_chain chain, &blk | |
chain = chain.split('.') if chain.is_a? String | |
metaclass.instance_eval do | |
define_method chain.first do |*values| | |
Object.new.tap do |o| |
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
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
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
messages = [nil, "Fizz", "Buzz", "FizzBuzz"] | |
acc = 810092048 | |
(1..100).each do |i| | |
c = acc & 3 | |
puts messages[c] || i | |
acc = acc >> 2 | c << 28 | |
end | |
# Explanation | |
# |
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
..='cd ..' | |
add='git add ' | |
admin='ssh-add && ssh admin' | |
b='cd ..' | |
be='bundle exec ' | |
branch='git branch ' | |
cata='cat ~/.dotfiles/bash/aliases' | |
cdev='cd ~/dev' | |
checkout='git checkout ' | |
co='git checkout ' |
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
from fabric.api import * | |
from fabric.contrib.files import exists | |
from fabric.contrib.project import upload_project | |
## Usage | |
# Full run, bootstraps if needed | |
# fab chef:name_of_runlist,hosts=1.1.1.1 --password=1234 --user=foo | |
# fab chef:name_of_runlist,hosts=1.1.1.1 -i=path/to/pem --user=foo |
OlderNewer