Skip to content

Instantly share code, notes, and snippets.

nmccready nmccready

Block or report user

Report or block nmccready

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nmccready
nmccready / gitSubmodulesUnFuck.sh
Last active Sep 12, 2018
unfuck git submodules
View gitSubmodulesUnFuck.sh
rm -rf $@ && git checkout origin/master $@ && git submodule update --init
@nmccready
nmccready / lodash.scala
Created Jul 27, 2018
once , delay scala like lodash
View lodash.scala
port java.util.{Timer, TimerTask}
val timer = new Timer
def delay(f: () => Unit, n: Long): Unit = timer.schedule(new TimerTask() { def run = f() }, n)
/*
Once wrapper from keeping calls from being excessively triggered by test to compile or vice versa
*/
def once[T](fn: () => T, within: Long = 1000): () => T = {
@nmccready
nmccready / shell.js
Last active Sep 19, 2018
easy running / chaining of spawn for gulp
View shell.js
const { spawn } = require('child_process');
const through = require('through2');
const Promise = require('bluebird');
const EventEmitter = require('events');
const logger = require('../debug').spawn('gulp:shell');
class NonZeroExit extends Error {
constructor(code, info) {
super();
@nmccready
nmccready / README.md
Created May 30, 2018
macOS HighSierra vbox
View README.md

macOS High Sierra VBox

VM setup

  • create new virtual machince macOS and target HighSierra 64
  • ICH9 Chipset
  • Network should be (Intel PRO/1000 MT Server)
  • Display Memeory max out to 128mb
  • cpu memory ~ 4096
  • 2 cpus
@nmccready
nmccready / parse.sh
Created May 29, 2018
parse simple options shell
View parse.sh
#!/bin/sh
while [[ "$#" > 0 ]]; do case $1 in
-d|--dependencies) dependencies=3;;
-n|--dry-run) dryRun=2;;
-t|--tag-only) tagOnly=1;;
*) echo "Unknown parameter passed: $1"; exit 1;;
esac; shift; done
View gitRemoveAllMyRemotesMerged.sh
#!/bin/sh
#http://stackoverflow.com/questions/6127328/how-can-i-delete-all-git-branches-which-have-been-merged
git branch -r --merged origin/master | grep -v "^.*master" | grep nmccready | sed s:origin/:: |xargs -n 1 git push --delete origin
@nmccready
nmccready / StringStream.js
Created Apr 18, 2018
node streams utlities
View StringStream.js
const { Readable } = require('stream');
module.exports = class StringStream extends Readable {
constructor(str) {
super();
this.push(str);
this.push(null);
}
_read() {}
};
@nmccready
nmccready / promise.js
Created Apr 9, 2018
poorman promises (some of bluebird , some of RSVP)
View promise.js
import { Promise } from 'es6-promise';
import '../async';
import { map as loMap } from '../../utils/lodash';
import { PromiseTypeError } from '../../errors';
/* keeping bundle size down and shimming Promise utilities as we need them */
if (!Promise.TypeError) {
Promise.TypeError = PromiseTypeError;
}
@nmccready
nmccready / lodash.js
Created Apr 6, 2018
poor mans lodash
View lodash.js
/*
Poor man's lodash to keep bundle down
*/
export function iteratee(obj, cb, { bail = false } = {}) {
for (const key in obj) {
if (key in obj) {
const maybeBreak = cb(obj[key], key);
if (bail && maybeBreak === false) break;
}
}
@nmccready
nmccready / docker-ember.sh
Created Apr 6, 2018
docker run container in bash
View docker-ember.sh
docker run --rm -it -v $(pwd):/myapp -p 4200:4200 -p 7020:7020 -p 7357:7357 danlynn/ember-cli:2.16.2 bash
You can’t perform that action at this time.