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
gsub_file "Gemfile", /^\#.*\n/, '' | |
gsub_file "Gemfile", /^\n/, '' | |
gem_group :development, :test do | |
gem 'rspec-rails' | |
gem 'capybara' | |
gem 'factory_girl_rails' | |
end | |
gem 'slim-rails' |
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
setw -g mode-keys vi | |
set -g status-keys vi | |
bind-key -t vi-edit Up history-up | |
bind-key -t vi-edit Down history-down | |
bind-key | split-window -h | |
bind-key - split-window -v | |
is_vim='echo "#{pane_current_command} | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' | |
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" | |
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" | |
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" |
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
setw -g mode-keys vi | |
set -g status-keys vi | |
bind-key -t vi-edit Up history-up | |
bind-key -t vi-edit Down history-down | |
bind-key | split-window -h | |
bind-key - split-window -v | |
is_vim='echo "#{pane_current_command} | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' | |
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" | |
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" | |
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" |
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 | |
require 'watir-webdriver' | |
require 'webrick/httpproxy' | |
# USAGE: ./proxied_browser.rb server (port) [json] | |
# ./proxied_browser.rb browser (port) | |
class ProxiedBrowser < Watir::Browser | |
def initialize(port) | |
proxy = ['localhost',port].join(?:) |
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
// Place all the styles related to the pages controller here. | |
// They will automatically be included in application.css. | |
// You can use Sass (SCSS) here: http://sass-lang.com/ | |
.splash { | |
@extend .col-xs-12; | |
background: linear-gradient(to bottom, rgba(20, 20, 80, 0.5) 0%, rgba(20, 20, 80, 0.5) 100%), url(hero2.jpg); | |
background-size: cover; | |
min-height: 85vh; | |
color: #DED; |
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 bash | |
if [[ $# -ne 2 ]]; then | |
echo "Usage: $0 ./encrypted/dir ./visible/dir" | |
fi | |
/usr/bin/encfs $(readlink -f $1) $(readlink -f $2) |
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 CreateFriendships < ActiveRecord::Migration | |
def change | |
create_table :friendships do |t| | |
t.belongs_to :person, index: true, null: false, foreign_key: true | |
t.belongs_to :friend, index: true, null: false, foreign_key: true | |
t.timestamps null: false | |
end | |
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
#!/usr/bin/env ruby | |
pwd = `pwd`.strip | |
targets = if ARGV.empty? | |
Dir["#{pwd}/*"] | |
else | |
ARGV.map do |arg| | |
Dir["#{arg.strip.gsub(/\/*$/,'')}/*"] | |
end.flatten.uniq | |
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
require 'music_player' | |
require 'timer' | |
class AlarmClock | |
def initialize(music_player, timer) | |
@music_player = music_player | |
@timer = timer | |
end | |
def start | |
@timer.start { @music_player.start } |
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 | |
require 'webrick/httpproxy' | |
port = ARGV[0] or 8000 | |
server = WEBrick::HTTPProxyServer.new(Port: port) | |
server.mount_proc('/'){|req,res|} | |
server.start |
OlderNewer