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
VBoxManage modifyvm "mybox" --natpf1 "rails,tcp,,3000,,3000" | |
VBoxManage modifyvm "mybox" --natpf1 "guestssh,tcp,,2222,,22" |
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 NullObject | |
def nil?; true; end | |
def !; true end | |
def to_a; []; end | |
def to_s(*args); ""; end | |
def to_str(*args); ""; end | |
def to_f(*args); 0.0; end | |
def to_i(*args); 0; end | |
def method_missing(*args, &blk) | |
self |
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
sudo apt-get install python-software-properties | |
sudo add-apt-repository ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git |
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
def generate_token | |
token = Digest::SHA1.hexdigest([Time.now, rand].join) | |
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
gem list | cut -d" " -f1 | xargs gem uninstall -aIx |
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
Host devbox | |
Hostname localhost | |
Port 2222 | |
User strika | |
ForwardX11 yes | |
ForwardX11Trusted yes | |
ForwardAgent yes | |
StrictHostKeyChecking no | |
UserKnownHostsFile=/dev/null |
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
#!/bin/bash | |
set -o errexit | |
git filter-branch --tree-filter "git rm -r -f --ignore-unmatch *.psd" HEAD | |
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune |
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 "yaml" | |
ROOT = File.expand_path('..', File.dirname(__FILE__)) | |
puts "Project root: #{ROOT}" | |
db_file = File.join(ROOT, "config", "database.yml") | |
puts "database.yml path: #{db_file}" | |
db_configuration = YAML.load_file(db_file) | |
puts "Database configuration:" |
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
function getScopes(root) { | |
var scopes = []; | |
function traverse(scope) { | |
scopes.push(scope); | |
if (scope.$$nextSibling) | |
traverse(scope.$$nextSibling); | |
if (scope.$$childHead) | |
traverse(scope.$$childHead); | |
} | |
traverse(root); |
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
1. Figure out the data set | |
2. Split the data set into resources. | |
For each kind of resource: | |
3. Name the resources with URIs. | |
4. Expose a subset of the uniform interface. | |
5. Design the representation(s) accepted from the client. | |
6. Design the representation(s) served to the client. | |
7. Integrate this resource into eisting resources, using hypermedia links and forms. | |
8. Consider the typical course of events: what's supposed to happen? | |
9. Consider error conditions: what might go wrong? |
OlderNewer