Skip to content

Instantly share code, notes, and snippets.

View mllrjb's full-sized avatar

Jason Miller mllrjb

View GitHub Profile
@mllrjb
mllrjb / Jenkinsfile
Created October 20, 2016 20:48
Jenkinsfile-kitchen-sink
#!groovy
/**
* Requires tool definitions for nodejs, jdk, maven, and ant
* Requires config files .npmrc and maven-settings.xml
*/
node() {
// checkout clean code
stage("checkout") {
checkout scm
@mllrjb
mllrjb / migrate.js
Created December 5, 2016 18:03
Umzug Migration
const path = require('path')
, Umzug = require('umzug')
, Bluebird = require('bluebird')
const db = {
// sequelize instance
sequelize: null,
// Sequelize constructor
Sequelize: null
};
@mllrjb
mllrjb / pipe.js
Created December 5, 2016 18:10
Piping Expressjs to another API via requestjs
'use strict';
const request = require('request');
module.exports = function forward(req, res, next) {
var myRequest = request({
url: req.url,
headers: req.headers
});
req.pipe(myRequest)
@mllrjb
mllrjb / _utility.spacing.scss
Created January 7, 2017 21:10
Sass padding and margin utilities
/*
Spacing
- - - - - - - - - - - - - - - - - - - - - - - - -
Helper classes for spacing like margin and padding.
Class names follow this convention:
.[type][direction][size]
@mllrjb
mllrjb / _utility.border.scss
Created January 7, 2017 21:10
Sass border utility
/*
Borders
- - - - - - - - - - - - - - - - - - - - - - - - -
Helper classes for adding borders to elements
Class names follow this convention:
.[type][direction][size]
@mllrjb
mllrjb / readme.md
Last active May 29, 2019 21:03
JavaScript interview question (banana)

What does the following output?

# what will the following code output?

const arr = [5, 9, 4, 12];
for (var i = 0; i < arr.length; i++) {
  setTimeout(function() {
    console.log('Index: ' + i + ', element: ' + arr[i]);
 }, 3000);