Skip to content

Instantly share code, notes, and snippets.

View stockhuman's full-sized avatar

Michael Hemingway stockhuman

View GitHub Profile
@stockhuman
stockhuman / simple-localstorage.js
Last active October 14, 2016 16:39
Sets and retrieves a key to select user UI color preference
/* Arthem Co.
* Let "doot" be a reserved private variable.
*
* Michael Hemingway 2016
*/
(function () {
'use strict';
// HELPER FUNCTIONS
@stockhuman
stockhuman / reintegrate.sh
Created May 1, 2018 14:58
Reintegrates an svn branch into trunk interactively
#!/bin/bash
# Automatically reintegrates a branch into trunk
# Version 1.2.2 | March 29, 2018
BRANCH=${1}
ALIVE=${2:---alive}
DELDIR=${3:---keep-folder}
# style variables
RED=$(tput bold; tput setaf 1)
@stockhuman
stockhuman / gulpfile.js
Created May 14, 2018 14:54
local php gulpfile for sass & js
/*
CSLP (c) 2018
==
run the whole shabang with `$ gulp watch` in the project directory
install them all with
$ npm i -D gulp gulp-sass gulp-connect-php gulp-concat gulp-rename gulp-uglify gulp-if browser-sync
*/
const gulp = require('gulp')
const sass = require('gulp-sass')
@stockhuman
stockhuman / gulpfile.js
Last active July 3, 2018 16:52
Gulp v.4 with piping to a live server
/*
CSLP (c) 2018
==
run the whole shabang with `$ gulp` in the project directory
install them all with
$ npm i -D gulp gulp-sass gulp-babel gulp-concat gulp-uglify gulp-rename gulp-sourcemaps gulp-autoprefixer browser-sync
Note that this gulpfile uses Gulp 4 syntax
*/
@stockhuman
stockhuman / css.css
Created September 28, 2018 23:49
A collection of neat and performance-conscious CSS
* {
box-sizing: border-box;
position: relative;
}
/* Smooth easings */
.enter {
animation-timing-function:
cubic-bezier(0, .5, .5, 1);
@stockhuman
stockhuman / cgid.js
Created February 16, 2019 20:56
Manipulate XLSX spreadsheets with node
const xlsx = require('xlsx') // install dependencies such as this with 'npm install'
let fileNeedle // declares the file we're extracting terms from
let fileHaystack // the file we will search in with file_a's terms
let needles = [] // strings we're finding out and searching with
let output = [] // placeholder output
// USAGE:
// pass files as arguments like $ node jizz.js "file_a" "file_b"
// install dependencies such as this with 'npm install xlsx'
const xlsx = require('xlsx')
const { gray, cyan, red, yellow, blue, black, green } = require('ansi-colors')
/**
* USAGE
*
* node filter.js <searchterm> <file to search> <data file>
*/
const query = process.argv[2] // the term we're looking for