Skip to content

Instantly share code, notes, and snippets.


James Mulholland mulholio

Block or report user

Report or block mulholio

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
mulholio / git-commit-branch-prefixes
Last active Nov 8, 2018 — forked from indexzero/git-commit-prefixes
Short list of Git commit and branch prefixes
View git-commit-branch-prefixes
## Prefixes
[del]: Delete code
[dist]: Changes to submodules, version bumps, updates to package.json
[doc]: Updates to documentation
[feat]: New feature
[fix]: Bug fixes
[infra]: Infrastructure changes
[merge]: Resolved git merge from upstream or otherwise
[nit]: Small changes: syntax, typos
[refact]: Refactor
mulholio /
Created Feb 12, 2019
Update your development Rails database with the latest copy of your production Heroku database
dropDB() {
# set db username (might not be $USER in your case)
local username="$USER"
local dbname="YOUR_DATABASE_NAME" # your sushi_app_development
rake db:create
# you might need a password in here for your machine
mulholio /
Created Feb 27, 2019
Removes Postgres' `` file for when you computer shuts down incorrectly (e.g. battery failure) and Postgres won't start
# run this in your terminal
rm ~/Library/Application \Support/Postgres/var-10/
View How to do what npm audit --fix does with yarn.txt
$ yarn audit # when this fails
# Try this to deeply upgrade a package
$ yarn upgrade parentFailingPackage
View Change permissions on a new bash script to make it
# allow running of the script
chmod u+x
# and if you want to add this script to your path...
cp ./ /usr/local/bin/new-script
# now you can run from anywhere with
View Mock named imports with jest differently for each test.txt
jest.mock('./module-to-mock', () => ({
functionToMock: jest.fn()
import { functionToMock } from './module-to-mock'
it('test1', () => {
functionToMock.mockImplementation(() => 'someValue')
it('test2', () => {
mulholio / useKeyDown.ts
Created Jan 16, 2020
React hook to make use of key presses
View useKeyDown.ts
import { useCallback, useEffect } from 'react';
type Key =
| 'a'
| 'b'
| 'c'
| 'd'
| 'e'
| 'f'
| 'g'
You can’t perform that action at this time.