- Move
focus
to somewhere on yourPATH
- Drop
focus.vim
in~/.vim/plugins
- Put focus on a key. I went with
nnoremap <leader>tf :call Focus()
. - Open a test/unit file, put your cursor inside a test method and run focus.
- Profit
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
set surround | |
set commentary | |
set easymotion | |
set ideajoin | |
set NERDTree | |
set relativenumber | |
set number | |
map \r :action RunAnything<CR> |
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
A Markdown and Unfurling Saavy Text Cell | |
Empty Cell* | |
click inside -> Edit Cell | |
Edit Cell | |
type markdown -> Edit Cell | |
type URL -> Edit Cell with unfurl | |
Edit Cell with unfurl | |
click save -> Populated Cell | |
click outside -> Populated Cell | |
Populated Cell |
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
Allocations ------------------------------------- | |
null 0/0 alloc/ret 0/0 strings/ret | |
mega no work 1/0 alloc/ret 0/0 strings/ret | |
mega w/ locals 1446/114 alloc/ret 50/50 strings/ret | |
chained 1334/0 alloc/ret 50/0 strings/ret | |
lazy chained 2102/0 alloc/ret 50/0 strings/ret | |
Warming up -------------------------------------- | |
null 151.895k i/100ms | |
mega no work 6.384k i/100ms | |
mega w/ locals 135.000 i/100ms |
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 'thread' | |
require 'ffaker' | |
require 'json' | |
def new_message | |
text = Faker::HipsterIpsum.sentences(3) | |
metrics = { | |
temp: rand(110), # degrees F | |
mass: rand(100), # kilograms | |
speed: rand(70) # miles per hour |
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
# Simple Queue | |
# ------------ | |
# | |
# A riff on bitly's HTTP-based simple queue[1] | |
# | |
# [1] https://github.com/bitly/simplehttp/blob/master/simplequeue/simplequeue.c | |
# | |
# Is it any good? | |
# =============== | |
# |
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
# http://weblog.therealadam.com/2012/06/19/getting-started-with-ruby-concurrency-using-two-simple-classes/ | |
require 'thread' | |
require 'timeout' | |
module Work | |
@queue = Queue.new | |
@n_threads = 2 | |
@workers = [] | |
@running = true |
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
# Postbin | |
# ------- | |
# A postbin for your localhost. | |
# | |
# Usage | |
# ===== | |
# | |
# It's a Unix program. You run it from a shell. | |
# | |
# $ ./postbin [-p PORT] |
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/sh | |
max_violations=0 # We run a tight ship... | |
complexity_max=60 # ...but we've got stuff to clean up | |
cane \ | |
--max-violations $max_violations \ | |
--abc-glob '{app,lib}/**/*.rb' \ | |
--abc-max=$complexity_max \ | |
--no-style \ |
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
# Suppose we're going to have a bunch of code like the following | |
# boilerplate (ignore the unfortunate nil propagation) | |
@city = begin | |
GizmoStore::Thingy.get(123) | |
rescue GizmoStore::NotFound | |
nil | |
end | |
# I can't decide if this is useful boilerplate elimination or | |
# saccharine ivory tower abstraction. |
NewerOlder