Skip to content

Instantly share code, notes, and snippets.

View mhaylock's full-sized avatar

Mark Haylock mhaylock

  • abitofthought.com
  • Christchurch, New Zealand
View GitHub Profile
@mhaylock
mhaylock / nock.js
Last active January 17, 2020 10:49
Integrating Nock with Jest
const nock = require('nock')
// Prevent requests being made to any outside services:
nock.disableNetConnect()
// Allow requests through to localhost, which is used by SuperTest to send
// requests during integration tests:
const localhost = '127.0.0.1'
nock.enableNetConnect(localhost)
@mhaylock
mhaylock / gist:958381
Created May 6, 2011 03:14
Setting up GIT Bash autocompletion

Run the following to create ~/.git-completion.bash:

curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash > ~/.git-completion.bash

Then add the following to your ~/.bashrc or ~/.bash_profile after PATH:

# Set the base PS1
PS1="\h:\W \u\$ "

Source the git bash completion file