Skip to content

Instantly share code, notes, and snippets.

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']

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 July 10, 2014 19:32
KeyRemap4MacBook config to match Mac keyboard functions
<?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 09:07
More verbosity on specific Cap v3 tasks
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 April 23, 2014 07:55
Capistrano v3 custom Submodule Strategy example
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/scm'
require 'capistrano/git'
class Capistrano::Git < Capistrano::SCM
module SubmoduleStrategy
include DefaultStrategy
def release
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 January 14, 2013 21:46
within implementation using Command/CompositeCommand
require 'rspec'
require 'stringio'
class Executor
def initialize(io)
@io = io
end
def commands
@commands ||= []
@seenmyfate
seenmyfate / vimrc
Created December 29, 2011 20:07
Starting point
" 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
# 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 :+
if RUBY_VERSION =~ /1.9/
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end