Skip to content

Instantly share code, notes, and snippets.

View pinkhominid's full-sized avatar

John Ericson pinkhominid

View GitHub Profile
@pinkhominid
pinkhominid / subl-user-prefs.json
Last active January 26, 2019 05:21
My Sublime Text user preferences
{
"ensure_newline_at_eof_on_save": false,
"font_size": 13,
"ignored_packages":
[
],
"rulers":
[
100
],
/**
* @category Common Helpers
* @summary Convert the given argument to an instance of Date.
*
* @description
* Convert the given argument to an instance of Date.
*
* If the argument is an instance of Date, the function returns its clone.
*
* If the argument is a number, it is treated as a timestamp.
@pinkhominid
pinkhominid / .bash_profile
Last active November 30, 2018 22:59
My macOS Bash dotfiles
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
@pinkhominid
pinkhominid / history-event.js
Last active February 12, 2021 20:13
Custom historychangestate event for web apps that use history.pushState or history.replaceState
export const HISTORY_STATE_CHANGE_EVENT = 'historystatechange';
history.pushState = changeState(history.pushState)
history.replaceState = changeState(history.replaceState)
window.addEventListener('popstate', fireStateChange)
setTimeout(fireStateChange);
function changeState(orig) {
return (...args) => {