Skip to content

Instantly share code, notes, and snippets.

@barretts
barretts / RemarkablePlugin.js
Last active August 7, 2020 11:52
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
@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 / 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 / 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 / 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 / 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 / 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 / Sorting a HEX color swatch palette.js
Last active June 13, 2017 16:27
Sorting a HEX color swatch palette
const coloursArray = ['#ffffff', '#eaeaea', '#666666', '#dddddd', '#c5c5c5', '#f4f4f4', '#000000', '#74cf9b', '#cccccc', '#00a4d6', '#0045b7', '#1c1c1c', '#222222', '#04c04c', '#f9f9f7', '#f89406', '#e5e5e5', '#f5f5f5', '#049cdb', '#a80808', '#5bc0de', '#0077b3', '#3a87ad', '#ee5f5b', '#111111', '#2f96b4', '#040404', '#f3e97a', '#fdf59a', '#46a546', '#149bdf', '#62c462', '#b3b3b3', '#c09853', '#f2f2f2', '#f9f9f9', '#fbb450', '#00286b', '#0480be', '#151515', '#155a95', '#29d29d', '#339bb9', '#444444', '#57a957', '#999999', '#c43c35', '#f3c17a', '#fdd49a', '#ffaa07', '#333333', '#777777', '#bd362f', '#eeeeee', '#ff959f', '#fffac8', '#2d6987', '#356635', '#7ab5d3', '#7aba7b', '#953b39', '#b1f4ce', '#cdf6ff', '#d59392', '#d9edf7', '#dbc59e', '#e6e6e6', '#e8f9ff', '#fcf8e3', '#ff726d', '#002b80', '#007ed2', '#368959', '#36f36f', '#3fb773', '#48c9e2', '#6f8092', '#a47e3c', '#c00c00', '#c18c91', '#c6c6c6', '#efefef', '#f7f7f7', '#0085ad', '#08c08c', '#0d3a5f', '#0e0e0e', '#0e90d2', '#1a1a1a', '#1b1b1b', '#1f6377', '
@barretts
barretts / Golf Course.less
Created July 11, 2017 16:48
Golf Course Dovetail Agent theme
@import "../agent/a5-theme";
/**
* ____ _ __ ____
* / ___| ___ | |/ _| / ___|___ _ _ _ __ ___ ___
* | | _ / _ \| | |_ | | / _ \| | | | '__/ __|/ _ \
* | |_| | (_) | | _| | |__| (_) | |_| | | \__ \ __/
* \____|\___/|_|_| \____\___/ \__,_|_| |___/\___|
*
*/
Install nodemon
npm install -g nodemon
Copy this file to your $HOME folder
https://gist.github.com/styson/7d56bafc9d1b7fe1ff1d3dd907b7bf0c
run this command from your bash cmd window