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
# Add these functions to your Bash profile. | |
# Copies the current directory to the clipboard | |
function cwd { | |
pwd | pbcopy | |
} | |
# Changes the current directory, after new tab has been loaded | |
function chwd { | |
DIR=`pbpaste` |
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 deepClone(source){ | |
// If the source isn't an Object or Array, throw an error. | |
if ( !(source instanceof Object) || source instanceof Date || source instanceof String) { | |
throw 'Only Objects or Arrays are supported.' | |
} | |
// Set the target data type before copying. | |
var target = source instanceof Array ? [] : {}; | |
for (let prop in source){ |
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
import load from "little-loader"; | |
import qs from "query-string"; | |
// YOUR_API_KEY - string | |
// libraries - array of strings, eg ['places'] | |
const loadGoogleMaps = (YOUR_API_KEY, libraries) => { | |
return new Promise( (resolve, reject) => { | |
var params = {key: YOUR_API_KEY, libraries: libraries} |
OlderNewer