This file contains hidden or 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 "rubygems" | |
require 'rspec/rails' | |
require 'kameleon' | |
require 'kameleon/ext/rspec/dsl' | |
require 'support/_support/helpers' | |
include Capybara::DSL | |
Capybara.default_selector = :css | |
Capybara.default_wait_time = 2 | |
Capybara.default_driver = :selenium |
This file contains hidden or 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 'ripl' | |
config.after(:each) do | |
if exception = example.instance_variable_get(:@exception) | |
save_and_open_page unless Capybara.current_driver == :selenium | |
Ripl.start :binding => binding | |
end | |
end |
This file contains hidden or 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
# http://www.rubyquiz.com/quiz5.html | |
# SOKOBAN | |
# gem install highline | |
require 'highline/system_extensions' | |
include HighLine::SystemExtensions | |
class String | |
# define methods: | |
# crate? garage? wall? man? | |
{ 'crate?' => /o|\*/, 'garage?' => /\.|\*/,'man?' => /@|\+/, 'wall?' => /#/ }. |
This file contains hidden or 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
tmux new-session -s main -n "Finch & Gmail" -d | |
tmux split-window -v -t main | |
tmux split-window -h -t main:1.0 | |
tmux split-window -h -t main:1.1 | |
tmux send-keys -t main:1.0 'finch' C-m | |
tmux send-keys -t main:1.1 'w3m mail.google.com/mail/u/0/?ui=html' C-m | |
tmux send-keys -t main:1.3 'mocp' C-m | |
tmux new-window -n Browser -t main | |
tmux send-keys -t main:2 'w3m google.com' C-m |
This file contains hidden or 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
# set default prefix | |
set -g prefix C-w | |
unbind C-b | |
# set start index | |
set -g base-index 1 | |
# default time to repeat | |
set -g repeat-time 1000 |
This file contains hidden or 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 Ip < Array | |
def initialize(arg) | |
case arg | |
when Array # array with octets | |
concat(arg) | |
when /(\d{1,3}\.){3}\d{1,3}/ # string with decimal address - splitted by dots | |
concat(arg.split('.')).map!(&:to_i) | |
when /\d{1,32}/ # string with binary address - not splitted by dots | |
concat(arg.scan(/\d{1,8}/).map { |oct| oct.to_i(2) }) | |
else |
NewerOlder