Skip to content

Instantly share code, notes, and snippets.

Nathan Hurst nahurst

Block or report user

Report or block nahurst

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Keybase
### Keybase proof
I hereby claim:
* I am nahurst on github.
* I am nahurst ( on keybase.
* I have a public key ASAcZEaVzPl4LOjSEYoWnWnilVDgU7z3upJ64MmSUg_OCQo
To claim this, I am signing this object:
nahurst /
Created May 3, 2017
Open to a particular line from iterm

Often when running tests, you'll see output like:

at Context.<anonymous> (tests/domains/MySchoolPage/WishList/SchoolWishListRowLayout-test.jsx:50:58)

If you Cmd+Click on the file path, you can go directly to the line position of the problem by doint the following:

Open iTerm > Preferences > Profiles > (Your Profile) > Advanced > Semantic History Choose "Run command..." Enter something like

nahurst / singleTest.js
Created Mar 28, 2017
Run a single test with Mocha
View singleTest.js
describe('something', () => {});
describe.only('something', () => {});
nahurst /
Last active Aug 1, 2016
Graph .dot format for graphvis and omnigraffle
digraph "g" {
Paco [fillcolor="#FF6FF3", shape=box]
Paco -> List;
List -> "Lots Of People";
"Lots Of People" -> List;
List -> Archives;
View sinatra+thin+ssl.rb
#!/usr/bin/env ruby
# This code snippet shows how to enable SSL in Sinatra+Thin.
require 'sinatra'
require 'thin'
class MyThinBackend < ::Thin::Backends::TcpServer
def initialize(host, port, options)
nahurst /
Created Jan 15, 2016
Create self signed certificate
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
rm server.pass.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
View gist:e30bef22f260604220e9
sudo kextunload -b
sudo kextload -b
nahurst /
Created Nov 14, 2015
Find duplicate file names on OS X
# because we don't have findsn with fslint, we need to do it ourselves
# find . -type f -exec basename {} \; | \ # get the name of the file. could be substituted to do hashes here
# sort | \ # prep for counting
# uniq -c | \ # count occurences
# grep -v "^[ \t]*1 " | \ # mind the formatting
# awk '{print $2}' | \ # get only the file names, not the counts
# xargs -I {} find . -name '{}*' # find the location of the duplicates
find . -type f -exec basename {} \; | \
nahurst / index.html
Last active Oct 10, 2015
Basic Angular Bootstrap Inline Controller
View index.html
<html ng-app="myApp">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Basic App</title>
<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
nahurst /
Created Jun 10, 2015
Teach us something technical: command line
# set these in your .bash_profile, .bashrc, .zshrc first
HISTFILESIZE=100000 # how many lines to keep total
HISTSIZE=100000 # how many lines to keep for the current session
# oh-my-zsh will default to a reasonable 10000, but most bash defaults to a few hundred
# oh-my-zsh by default appends all commands to history after they are run instead of on session end
# search the history with control-r
# search for commands starting with the one you typed with alt-p
# if you don't want something to stay in your history, prefix the command with a space
You can’t perform that action at this time.