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 (https://keybase.io/nahurst) on keybase.
* I have a public key ASAcZEaVzPl4LOjSEYoWnWnilVDgU7z3upJ64MmSUg_OCQo
To claim this, I am signing this object:
@nahurst
nahurst / iterm.md
Created May 3, 2017
Open to a particular line from iterm
View iterm.md

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
nahurst / singleTest.js
Created Mar 28, 2017
Run a single test with Mocha
View singleTest.js
describe('something', () => {});
describe.only('something', () => {});
@nahurst
nahurst / graph.dot
Last active Aug 1, 2016
Graph .dot format for graphvis and omnigraffle
View graph.dot
digraph "g" {
rankdir="LR"
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
nahurst / self_sign.sh
Created Jan 15, 2016
Create self signed certificate
View self_sign.sh
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 com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@nahurst
nahurst / find_duplicate_file_names.sh
Created Nov 14, 2015
Find duplicate file names on OS X
View find_duplicate_file_names.sh
# 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
nahurst / index.html
Last active Oct 10, 2015
Basic Angular Bootstrap Inline Controller
View index.html
<html ng-app="myApp">
<head>
<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="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
@nahurst
nahurst / history.sh
Created Jun 10, 2015
Teach us something technical: command line
View history.sh
# 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.