Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am nlindley on github.
  • I am nlindley (https://keybase.io/nlindley) on keybase.
  • I have a public key ASBF4aC-Vw_FMQdssfSfdsxaRns910X0u-lPj6Bpj3CqJwo

To claim this, I am signing this object:

joi Logo

Object schema description language and validator for JavaScript objects.

Current version: 4.7.x

Build Status

Lead Maintainer: Eran Hammer

'.source.js':
'BDD Test Case':
'prefix': 'gwt'
'body': """
describe('Given $1', function() {
describe('When $2', function() {
it('Then $3', function(done) {
$4
done();
});

Foreman Setup

Install Homebrew

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install rbenv and ruby-build

@nlindley
nlindley / Capybara Cheat Sheet.md
Last active August 29, 2015 14:05
A Markdown version of the Capybara cheat from https://gist.github.com/zhengjia/428105

Capybara Cheat Sheet

Navigating

visit('/projects')
visit(post_comments_path(post))

Clicking links and buttons

@nlindley
nlindley / git-rmu
Created July 16, 2014 23:52
Script to remove untracked files in a git repository.
#!/bin/bash
git status -su | cut -d' ' -f2- | tr '\n' '\0' | xargs -0 rm
@nlindley
nlindley / sodastream-energy-drink-calculator.markdown
Last active January 4, 2016 06:39
This document is intended to be used in Calca (http://calca.io) and calculates how much money I save with a Sodastream vs. buying Red Bull.

Sodastream Savings over Red Bull

I was just curious how much I would be saving by mixing my own Red Bull-like energy drink using a Sodastream.

Variables

Change these to fit your situation.

tax rate = 9.375% serving size = 12 fl oz

@nlindley
nlindley / swap.sh
Created September 13, 2013 21:36
Swaps two files.
#!/bin/sh
if test $# -ne 2
then
echo "Usage: swap <filename> <filename>"
exit 1
fi
if test ! -w "$1"
then
@nlindley
nlindley / titleize-filename-for-heading.sh
Last active December 22, 2015 22:59
Silly one-liner that lists directory contents (for my use-case, they were only regular files), strips the extension, titleizes the filename, and prepends that as a Markdown heading.
for FILENAME in `ls`; do perl -pi -e "print \"# `ruby -e \"require 'active_support/inflector'; puts '${FILENAME%.md}'.titleize\"`\n\n\" if $. == 1" $FILENAME; done;
@nlindley
nlindley / archivepage.rb
Last active December 30, 2015 04:18 — forked from ilkka/archivepage.rb
module Jekyll
class ArchivePage < Page
include Convertible
attr_accessor :site, :pager, :name, :ext, :basename, :dir, :data, :content, :output
# Initialize new ArchivePage
# +site+ is the Site
# +month+ is the month
# +posts+ is the list of posts for the month