Skip to content

Instantly share code, notes, and snippets.

View nmccready's full-sized avatar

nmccready nmccready

View GitHub Profile
@nmccready
nmccready / webpack.config.js
Last active April 13, 2018 21:53
webpack es3 (for picky JS engines)
const path = require('path');
// const UnminifiedWebpackPlugin = require('unminified-webpack-plugin'); // for webpack 3 / 4.x
const ReplaceInFileWebpackPlugin = require('replace-in-file-webpack-plugin');
const GasPlugin = require('gas-webpack-plugin'); // for google-app-scripts
const { ProvidePlugin } = require('webpack');
const debug = require('./debug').spawn('webpack');
module.exports = {
entry: './index.js',
output: {
@nmccready
nmccready / submodule-pull.sh
Created January 22, 2018 20:18 — forked from stephenparish/submodule-pull.sh
Update submodules in a git repository to the latest, but exclude one..
git submodule foreach '[ "$path" == "submodule-to-exclude" ] || git pull origin master'
@nmccready
nmccready / ngDepsLater.js
Created August 30, 2017 15:32
add angular 1 dependencies later
// way to add dependencies
var app = angular.module('someApp');
app.requires.push('someDep');
@nmccready
nmccready / emitter.js
Created August 16, 2017 21:38
emitter extension
var Promise = require('bluebird');
var EventEmitter = require('events');
function toPromise(emitterLike) {
return new Promise(function(resolve, reject) {
emitterLike.once('finish', resolve);
emitterLike.once('end', resolve);
emitterLike.once('close', resolve);
return emitterLike.once('error', reject);
});
@nmccready
nmccready / readFiles.js
Created August 16, 2017 21:11
reading directories files into a list
const fs = require('fs');
const Promise = require('bluebird');
const debug = require('../debug.js').spawn('readFiles');
const _ = require('lodash');
const readdirAsync = Promise.promisify(fs.readdir);
const readFileAsync = Promise.promisify(fs.readFile);
/**
* Easy way for us to load all files in a directory and index the content by the filename
@nmccready
nmccready / gv-delete-history-legacy.user.js
Created May 12, 2017 17:32
Browser userscripts to delete all Google Voice history
// ==UserScript==
// @name Delete Google Voice (Legacy) History
// @description Deletes all Google Voice (Legacy) history
// @version 1.1.0
// @license MIT
// @namespace gavinhungry.io
// @author Gavin Lloyd <gavinhungry@gmail.com>
//
// @include https://www.google.tld/voice
// @include https://www.google.tld/voice/*
@nmccready
nmccready / dev.js
Created March 13, 2017 04:20 — forked from remy/dev.js
A webpack config with dynamic loader to be used with React
// filename: lib/dev.js
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const webpack = require('webpack');
// expects to live in ./lib
const config = Object.assign({}, require('../webpack.config.dev'), {
// customisations that were typically off, but I could turn on during experiments
});

macOS 10.12 Sonoma and Up Setup

Most things should work in newer versions of macOs with slight tweaks.

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

@nmccready
nmccready / hook_stdout.coffee
Last active October 11, 2016 21:03 — forked from bsatrom/hook_stdout.coffee
Samples for hooking into STDOUT for unit testing in Node.js
exports = module.exports
exports.setup = (callback) ->
write = process.stdout.write
process.stdout.write = ((stub) ->
(string, encoding, fd) ->
stub.apply process.stdout, arguments
callback string, encoding, fd)(process.stdout.write)
@nmccready
nmccready / index.html
Created July 27, 2016 17:25 — forked from anonymous/index.html
textarea fill height // source http://jsbin.com/siyene
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
html,
body {
height: 100%;