#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const app = express(); | |
const cache = [0, 3]; | |
const getPi = (series = 0) => { | |
if (series === 0) return 3; | |
const middle = 4 * series; | |
const head = 4 / ((middle - 2) * (middle - 1) * middle); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/schemes: | |
edge_light: &edge_light | |
primary: | |
background: "0xfafafa" | |
foreground: "0x4b505b" | |
normal: | |
black: "0x4b505b" | |
red: "0xd05858" | |
green: "0x608e32" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""Convert all of your Viscosity connections into OVPN configuration files for OpenVPN | |
https://gist.github.com/ishahid/693c2c97b3236a3c2416fc09ab170244 | |
""" | |
import re | |
import glob | |
from os.path import expanduser, dirname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const R = require('ramda'); | |
const csvToArray = csvText => | |
csvText | |
.split('\n') | |
.map(item => item.split(',')) | |
// new line will produce Array with length 1 & with value '' | |
// ignore it | |
.filter(item => item[0] !== ''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
let lastScrollTop = 0; | |
let scrollUpEvent = new Event("scrollUp"); | |
let scrollDownEvent = new Event("scrollDown"); | |
document.addEventListener("scroll", function(){ // or window.addEventListener("scroll".... | |
let scrollTop = window.pageYOffset || document.documentElement.scrollTop; | |
if (scrollTop > lastScrollTop){ | |
document.dispatchEvent(scrollDownEvent); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const curry = require('lodash/curry') | |
const match = curry(function(what, str) { | |
return str.match(what) | |
}) | |
const replace = curry(function(what, replacement, str) { | |
return str.replace(what, replacement) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( 'IntersectionObserver' in window ) { | |
const observer = new IntersectionObserver(callback, options) | |
observer.observe($el) | |
} else { | |
import(/* webpackChunkName: "intersection-observer" */ 'intersection-observer').then(_ => { | |
const observer = new IntersectionObserver(callback, options) | |
observer.observe($el) | |
}) | |
} |
These instructions will guide you through the process of setting up local, trusted websites on your own computer.
These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.
NOTE: You may substitute the edit
command for nano
, vim
, or whatever the editor of your choice is. Personally, I forward the edit
command to Sublime Text:
alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
NewerOlder