Skip to content

Instantly share code, notes, and snippets.

@nelstrom
nelstrom / stitch-word.vim
Created February 5, 2014 09:18
A Vim function to transform words to "stitch words", e.g. "Seattle" becomes "S-e-a-t-t-l-e"
function! StitchWord(word)
let word = substitute(a:word, '\v(\w)', '\1-', 'g')
let word = substitute(word, '\v(\w)-$', '\1', 'g')
return word
endfunction
inoremap <c-x>- <c-o>ciw<C-r>=StitchWord(@@)<CR>
@nelstrom
nelstrom / format-html-with-pandoc.vim
Created February 18, 2014 18:00
An autocommand to set up pandoc to reformat HTML with Vim's `gq{operator}` command.
function! FormatprgLocal(filter)
if !empty(v:char)
return 1
else
let l:command = v:lnum.','.(v:lnum+v:count-1).'!'.a:filter
echo l:command
execute l:command
endif
endfunction
@nelstrom
nelstrom / nose-errorformat.vim
Created February 26, 2014 10:26
An attempt at writing an errorformat for output from the nose test runner.
let &makeprg="cat nose.txt"
let &errorformat="%E%f line %l in test_foo,"
let &errorformat.="%C%m,"
let &errorformat.="%Z"
make!
copen
# OS ?= LINUX
#OS ?= WINDOWS
OS ?= MACOSX
#OS ?= BSD
ifeq ($(OS), LINUX) # also works on FreeBSD
CC ?= gcc
CFLAGS ?= -O2 -Wall
teensy_loader_cli: teensy_loader_cli.c
$(CC) $(CFLAGS) -s -DUSE_LIBUSB -o teensy_loader_cli teensy_loader_cli.c -lusb
<!DOCTYPE HTML>
<html>
<head>
<title>Pecha Kucha</title>
</head>
<body>
<div id="nav">
<ol>
</ol>
</div>

#01 - #collectivenouns

Do any of you use Twitter? [pause] If you feel inspired during this talk, please feel free to coin your own venereal terms by tweeting something like "a bunch of somethings" with the #collectivenouns hashtag. You'll find out why presently.

#02 - Etymology of venery

From Venus, the goddess of love and beauty, we get the Latin root ven,

@nelstrom
nelstrom / feature-test.js
Created October 27, 2014 10:30
Given-When-Then test style proposal
feature('foo bar', {
given: function() {
visit('/');
},
when: function() {
fillIn('#some-field', 'foo');
click('button:contains("Submit")');
},
@nelstrom
nelstrom / ember-cli.vim
Created February 12, 2015 08:50
Instead of running `:!ember g model blah`, use `:Ember g model blah`.
command! -nargs=* Ember :echo system('ember <args>')

For Sale: Filco Majestouch 2 tenkeyless Keyboard.

Here is [the Filco Majestouch 2 Tenkeyless Keyboard product listing][listing]. Tech specs:

  • Brown cherry MX key switches (tactile feel without audible 'click')
  • compact 88 key layout (with no number pad)
  • works both with USB and PS/2 ports
  • supports true N-Key rollover (NKRO)

Brand new, the keyboard sells for £114 (including VAT).

Build a 'mechanical turk' system

The system will poll people for answers to yes/no questions that are easily answered by humans but not by machines. If a certain number of people give the same answer to a question, it's marked as resolved and polling for that question ceases. If people give different answers to the same question, then polling will continue until a consensus is reached and that question can be marked as resolved.

When someone has answered a question, they may view a summary of all answers to that question.