SPC q q
- quitSPC w /
- split window verticallySPC w
- - split window horizontallySPC 1
- switch to window 1SPC 2
- switch to window 2SPC w c
- delete current windowSPC TAB
- switch to previous bufferSPC b b
- switch buffers
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
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 -e | |
IFADDR="192.168.3.1/24" | |
if [[ ! ip link show docker0 ]]; then | |
ip link add docker0 type bridge | |
ip addr add "$IFADDR" dev docker0 | |
ip link set docker0 up | |
iptables -t nat -A POSTROUTING -s "$IFADDR" ! -d "$IFADDR" -j MASQUERADE | |
fi |
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
# /etc/init/project-web-reload.conf | |
pre-start script | |
initctl restart project-web | |
sleep 15 | |
end script | |
exec /usr/local/rvm/bin/default_bluepill restart |
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
!!! 5 | |
%html | |
%head | |
%title= "Your Website" | |
%meta{ :content => "", :name => "description" } | |
%meta{ :content => "", :name => "author" } | |
%meta{ :content => "3 days", :name => "revisit-after" } | |
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" } | |
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" } | |
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" } |
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
# Note: This does not yet align 100% with out of the box devise. I will work on that. | |
Feature: Authentication | |
In order to protect my assets stored within a system | |
As any user | |
I would like to be verified as the rightful owner of those assets through authentication | |
Scenario: No authenticated user within the system | |
Given a user exists with email: "someuser@someuser.com" | |
And I am not authenticated |
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
load "deploy" if respond_to?(:namespace) # cap2 differentiator | |
DEPLOYMENT_CONFIG = YAML.load_file("./config/config.yml")["production"] | |
# Ref: https://github.com/capistrano/capistrano/issues/81#issuecomment-1994285 | |
require "bundler/capistrano" | |
# Uncomment if you are using Rails' asset pipeline | |
load "deploy/assets" |
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
namespace :deploy do | |
desc 'Bundle and minify the JS and CSS files' | |
task :precache_assets, :roles => :app do | |
root_path = File.expand_path(File.dirname(__FILE__) + '/..') | |
jammit_path = Dir["#{root_path}/vendor/gems/jammit-*/bin/jammit"].first | |
yui_lib_path = Dir["#{root_path}/vendor/gems/yui-compressor-*/lib"].first | |
assets_path = "#{root_path}/public/assets" | |
# Precaching assets | |
run_locally "ruby -I#{yui_lib_path} #{jammit_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
module CanCan | |
class Query | |
def sanitize_sql(conditions) | |
conditions | |
end | |
end | |
# customize to handle Mongoid queries in ability definitions conditions | |
class CanDefinition | |
def matches_conditions_hash?(subject, conditions = @conditions) |
NewerOlder