Skip to content

Instantly share code, notes, and snippets.


Lacy Morrow lacymorrow

View GitHub Profile
lacymorrow / console_save.js
Last active Jun 2, 2020
`` Save a javascript variable to a JSON file
View console_save.js
// Save a javascript variable to a JSON file
(function(console){ = function(data, filename){
if(!data) {
console.error(' No data')
View nextron-dev.js
#!/usr/bin/env node
'use strict';
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var fs = _interopDefault(require('fs'));
var arg = _interopDefault(require('arg'));
var chalk = _interopDefault(require('chalk'));
var spawn = _interopDefault(require('cross-spawn'));
var delay = _interopDefault(require('delay'));
lacymorrow / Utils.js
Created Aug 16, 2019
A handy collection of JS utility functions
View Utils.js
var Utils = {
sleep: function (milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds));
isUndefined: function (value) {
return typeof value === 'undefined';
isObject: function (o) {
return (
typeof o === 'object' &&
lacymorrow / docReady.js
Created Jan 28, 2019
A plain, vanilla, cross-browser JS document.ready function
View docReady.js
/* Credit to
* Call with docReady(fn, context)
(function(funcName, baseObj) {
"use strict";
// The public function name defaults to window.docReady
// but you can modify the last line of this function to pass in a different object or method name
// if you want to put them in a different namespace and those will be used instead of
// window.docReady(...)
lacymorrow /
Last active Jan 6, 2019
#vGet drive name
diskutil list
# then try
diskutil unmountDisk force /dev/DRIVENAME
# Then format
lacymorrow / js-sum.js
Created Sep 24, 2018
Simple function to sum an array
View js-sum.js
const numbers = [10, 20, 30, 40] // sums to 100
// function for adding two numbers. Easy!
const add = (a, b) =>
a + b
// use reduce to sum our array
const sum = numbers.reduce(add)
lacymorrow / .xinitrc
Created Sep 6, 2018 — forked from ncornette/.xinitrc
.xinitrc for kiosk mode
View .xinitrc
# invoke global X session script
#. /etc/X11/Xsession
# HOW-TO :
# 1. Disable any Display Manager (lightdm/gdm/gdm3) from executing on startup
# 2. Allow user to start X :
# a. Edit /etc/X11/Xwrapper.config
# b. Set value : "allowed_users=anybody"
# 3. insert "su kiosk -c xinit &" into /etc/rc.local
lacymorrow /
Last active Sep 5, 2018
VNC connection for MagicMirror2 Raspberry Pi -> MacOS
# SSH from the Mac to the Pi with
# -Y: X-11 (trusted) forwarding
# -L VNC forwarding
ssh -Y -L 5901:localhost:5901 pi@
# (in SSH session)
# Create VNC password
x11vnc -storepasswd
lacymorrow /
Last active Sep 4, 2018
Complete MagicMirror2 Installation
lacymorrow /
Last active Aug 31, 2018
Moving WordPress appearance to root directory from subdirectory

Moving process (p.s. If you've already installed WP in subdirectory, some steps might be already done automatically).

Create the new location for the core WordPress files to be stored (we will use /wordpress in our examples). (On linux, use mkdir wordpress from your www directory. You'll probably want to use chown apache:apache on the wordpress directory you created.) Go to the General Screen. In WordPress address (URL): set the address of your main WordPress core files. Example: In Site address (URL): set root directory's URL. Example:

You can’t perform that action at this time.