Skip to content

Instantly share code, notes, and snippets.

@barretts
barretts / css-filter-generator-to-convert-from-base-hex-color-to-target-hex-color.markdown
Last active March 26, 2021 09:15
CSS filter generator to convert from black to target hex color
@barretts
barretts / gulp-coverage.js
Created January 17, 2017 17:28
Code coverage sample files
var config = require('config.json');
var fs = require('fs');
var gulp = require('gulp');
var mochaPhantomJS = require('gulp-mocha-phantomjs');
var webpack = require('webpack');
var remapIstanbul = require('remap-istanbul/lib/gulpRemapIstanbul');
var coverageFile = './results/coverage/coverage.json';
gulp.task('webpack-coverage', function (cb) {
@barretts
barretts / npm-install.bat
Created November 17, 2015 03:32
npm install with retry on error from a Windows batch file
:: I created this increase CI/CD stability when running in cloud VMs; npm install failing is such a sad test failure
:: general batch loop thanks @AlexZhidkov https://github.com/FeodorFitsner/BedfordHarbourBOM/blob/master/nuget-restore.cmd
:: pipe npm, search log thanks @Ricky-Brno http://stackoverflow.com/a/22492458/604861
echo off
:: initiate the retry number
set retryNumber=0
set maxRetries=3
:RETRY
@barretts
barretts / Sample User Data
Last active September 3, 2015 18:24
Register Jenkins Slave from Windows in AWS
JENKINS_URL=http://bld.tld&SLAVE_PREFIX=TestIE&USER_NAME=bsonntag&USER_TOKEN=mytoken
@barretts
barretts / log.js
Created May 16, 2015 02:25
Sails.js configuration to use Winston logger output to file
var winston = require('winston');
/*
Sails.js Winston logger config
I was having trouble getting the logfile output to be verbose, having copied several from the web I finally came
up with this setup after reading the old Captian's Log configuration. Current problem is the doubling of verbose.
ex: verbose: verbose: Grunt :: Running "sails-linker:devStyles" (sails-linker) task
*/
var logger = new (winston.Logger)({
transports: [
@barretts
barretts / keybase.md
Created April 9, 2015 20:04
keybase.md

Keybase proof

I hereby claim:

  • I am barretts on github.
  • I am barretts (https://keybase.io/barretts) on keybase.
  • I have a public key whose fingerprint is 51C1 03F5 ACB5 FE91 1956 F80A 7F5E C71D C4D5 F40F

To claim this, I am signing this object:

@barretts
barretts / RemarkablePlugin.js
Last active February 2, 2025 22:08
Remarkable JS Markdown parser plugin tutorial
/**
* Created by Barrett Sonntag barretts@github on 3/2/2015.
* http://www.sosuke.com/writing-custom-extensions-for-the-remarkable-javascript-markdown-parser
*
* A plugin tutorial for Remarkable https://github.com/jonschlinkert/remarkable
*/
var markdownParser = new Remarkable();
// open links in new windows