Skip to content

Instantly share code, notes, and snippets.

View lacymorrow's full-sized avatar
🕶️
Grok'ing

Lacy Morrow lacymorrow

🕶️
Grok'ing
View GitHub Profile
@lacymorrow
lacymorrow / raspberrypi-backup-restore-sd.txt
Created August 12, 2018 05:27 — forked from wavecos/raspberrypi-backup-restore-sd.txt
Backup/Restore Raspberry Pi SD Card in Mac OS
# http://raspberrypi.stackexchange.com/questions/311/how-do-i-backup-my-raspberry-pi
diskutil list
# backup:
sudo dd if=/dev/disk2 of=raspberrypi20151118.img bs=1m
# restore:
dd if=sd.img of=/dev/sdb bs=4M
@lacymorrow
lacymorrow / isNode.js
Last active March 26, 2018 22:04
Returns `true` if running in a Node process
function isNode () {
return Object.prototype.toString.call( typeof process !== 'undefined' ? process : 0 ) === '[object process]'
}
“Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration.” — Stan Kelly-Bootle
@lacymorrow
lacymorrow / inset_input.css
Created February 28, 2018 00:53 — forked from nrrrdcore/inset_input.css
The Perfect Inset Input CSS
input {
height: 34px;
width: 100%;
border-radius: 3px;
border: 1px solid transparent;
border-top: none;
border-bottom: 1px solid #DDD;
box-shadow: inset 0 1px 2px rgba(0,0,0,.39), 0 -1px 1px #FFF, 0 1px 0 #FFF;
}
@lacymorrow
lacymorrow / .shortcuts
Created February 8, 2018 00:33
Git Shortcuts
# Determine details about a deleted file
git log -1 -- <file>
@lacymorrow
lacymorrow / gist:db4f7479db78bc58db8ac2078c38c5dc
Created December 14, 2017 00:08 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@lacymorrow
lacymorrow / util.css
Last active March 19, 2019 21:56
CSS Code Utilities
/* Text smoothing */
body {
font-family: Camphor, Open Sans, Segoe UI, sans-serif;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Nice hover effect
button:hover {
@lacymorrow
lacymorrow / loop-func.js
Last active November 17, 2017 09:19
JS - Loop a function call using setTimeout()
function doStuff() { return false; }
(function loopFunc() {
doStuff();
//setTimeout(arguments.callee, 100); // callee is deprecated
setTimeout(loopFunc, 100);
})()
@lacymorrow
lacymorrow / parse-url-params.js
Last active September 4, 2018 02:42
JS - Parse URL `GET` parameters from and HTTP request
/* function parseURLParams
* Accepts a http parameter string or grabs the one from the current URL
* Returns a dictionary
* Ex: '?api_key=XYZ&version=2' => { api_key: 'XYZ', version: 2}
*
* query: string | undefined
*/
function parseURLParams (query) {
if(!query)