Skip to content

Instantly share code, notes, and snippets.

View server.rb
require_relative 'helper'
class MyApp
def half_close(request)
[200, { 'content-type' => 'text/plan' }, 'Hello HTTP 2.0! GET request']
end
def promise(request)
[200, { 'content-type' => 'text/plan' }, 'A promise']
View README.md

YELLY!!!!! THE YELLINGIST FORMATTER EVER!!!!!

Yelly likes to yell. To make the magic happen for simple cases just invoke him ala:

bundle exec rspec --require=yelly_the_yellingist_formatter.rb --format=YellyTheYellingistFormatter spec/models/your_file_here_spec.rb

In closing, >:O

Updated to Rspec 3.0's formatter interface.

@seenmyfate
seenmyfate / private.xml
Created Jul 10, 2014
KeyRemap4MacBook config to match Mac keyboard functions
View private.xml
<?xml version="1.0"?>
<root>
<item>
<name>Map Function keys to match Apple</name>
<identifier>private.itunes_fkeys</identifier>
<autogen>__KeyToConsumer__ KeyCode::F1, ConsumerKeyCode::BRIGHTNESS_DOWN</autogen>
<autogen>__KeyToConsumer__ KeyCode::F2, ConsumerKeyCode::BRIGHTNESS_UP</autogen>
<autogen>__KeyToKey__ KeyCode::F3, KeyCode::EXPOSE_ALL</autogen>
<autogen>__KeyToKey__ KeyCode::F4, KeyCode::LAUNCHPAD</autogen>
<autogen>__KeyToConsumer__ KeyCode::F5, ConsumerKeyCode::KEYBOARDLIGHT_LOW</autogen>
@seenmyfate
seenmyfate / verbosity.cap
Created May 1, 2014
More verbosity on specific Cap v3 tasks
View verbosity.cap
task :debug do
SSHKit.configure { |config| config.output_verbosity = :debug }
end
task :reset_log_level do
SSHKit.configure { |config| config.output_verbosity = fetch(:log_level) }
end
before 'deploy:migrate', 'debug'
after 'deploy:migrate', 'reset_log_level'
@seenmyfate
seenmyfate / Capfile
Created Apr 23, 2014
Capistrano v3 custom Submodule Strategy example
View Capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/scm'
require 'capistrano/git'
class Capistrano::Git < Capistrano::SCM
module SubmoduleStrategy
include DefaultStrategy
def release
View gist:7598331
FAIL (1:00:18.482) test_execute_raises_on_non_zero_exit_status_and_captures_stdout_and_stderr
--- expected
+++ actual
@@ -1,3 +1,3 @@
"echo stdout: Nothing written
-echo stderr: Test capturing stderr
+echo stderr: Nothing written
"
@seenmyfate
seenmyfate / gist:4533828
Created Jan 14, 2013
within implementation using Command/CompositeCommand
View gist:4533828
require 'rspec'
require 'stringio'
class Executor
def initialize(io)
@io = io
end
def commands
@commands ||= []
@seenmyfate
seenmyfate / vimrc
Created Dec 29, 2011
Starting point
View vimrc
" http://mislav.uniqpath.com/2011/12/vim-revisited/
set nocompatible " choose no compatibility with legacy vi
syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
filetype plugin indent on " load file type plugins + indentation
"" Whitespace
set nowrap " don't wrap lines
View tmux.conf
# act like vim
# thanks thoughtbot
# http://robots.thoughtbot.com/post/2166174647/love-hate-tmux
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
View gist:1430704
if RUBY_VERSION =~ /1.9/
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end