Skip to content

Instantly share code, notes, and snippets.

View DMP.js
// 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
@stockHuman
stockHuman / cgid.js
Created Feb 16, 2019
Manipulate XLSX spreadsheets with node
View cgid.js
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"
@stockHuman
stockHuman / css.css
Created Sep 28, 2018
A collection of neat and performance-conscious CSS
View css.css
* {
box-sizing: border-box;
position: relative;
}
/* Smooth easings */
.enter {
animation-timing-function:
cubic-bezier(0, .5, .5, 1);
@stockHuman
stockHuman / gulpfile.js
Last active Jul 3, 2018
Gulp v.4 with piping to a live server
View gulpfile.js
/*
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 / gulpfile.js
Created May 14, 2018
local php gulpfile for sass & js
View gulpfile.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 / reintegrate.sh
Created May 1, 2018
Reintegrates an svn branch into trunk interactively
View reintegrate.sh
#!/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 / simple-localstorage.js
Last active Oct 14, 2016
Sets and retrieves a key to select user UI color preference
View simple-localstorage.js
/* Arthem Co.
* Let "doot" be a reserved private variable.
*
* Michael Hemingway 2016
*/
(function () {
'use strict';
// HELPER FUNCTIONS