Skip to content

Instantly share code, notes, and snippets.

View imaustink's full-sized avatar

Austin Kurpuis imaustink

View GitHub Profile
@imaustink
imaustink / mongo-connection-url.js
Created March 3, 2016 17:21
Simple Mongo DB connection URL generator in JavaScript
function mongoURL(options) {
options = options || {};
var URL = 'mongodb://';
if (options.password && options.username) URL += options.username + ':' + options.password + '@';
URL += (options.host || 'localhost') + ':';
URL += (options.port || '27017') + '/';
URL += (options.database || 'admin');
return URL;
}
@imaustink
imaustink / gulpfile.js
Created October 15, 2016 22:02
Lambda build tasks
var argv = require('yargs').argv;
var chmod = require("gulp-chmod");
var debug = require('gulp-debug');
var fs = require('fs');
var gulp = require('gulp');
var gutil = require('gulp-util');
var istanbul = require('gulp-istanbul');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var path = require('path');
@imaustink
imaustink / extended_array.js
Last active December 19, 2016 17:55
ES6 is fun
class Pages extends Array{
constructor(){
super().push.apply(this, arguments);
this.i = 0;
}
get next(){
return this[this.i++];
}
}
var p = new Pages(1,2,3,4,5,6,7,8,9,10);
'use strict';
const Request = require('request');
const Cheerio = require('cheerio');
const fs = require('fs');
const STORE_URL = 'https://www.site-domain.com/';
const req = Request.defaults({jar: true});
require('request-debug')(Request);
req.post({
url: `${STORE_URL}account/login`,
@imaustink
imaustink / git.md
Last active March 12, 2017 20:30
git basics

Git Basics

First off lets start with some simples rules.

  • Don't commit directly to master, only merge to master.
  • Only merge to master if the source branch is stable.
  • Never fucking force push (-f or --force) to fucking anything ever.
  • Don't use rm or your file manager to delete files. Use git rm instead.
  • Linus Torvalds is the Supreme Leader. All hail the Supreme Leader!
@imaustink
imaustink / bitovi-agenda.md
Last active March 26, 2017 21:41
Bitovi Interview Agenda

Agenda

Interview with Justin Meyer & Brian Moschel. Brian's cell: (847) 727-1609

03/27/2017

06:00 AM (PST)

Wake Up.

07:30 AM (PST)

Depart Ellensburg.

09:30 AM (PST)

@imaustink
imaustink / can-globals-examples.md
Last active April 18, 2017 22:12
Can globals examples

Examples

Setting Default Properties

const globals = require('can-globals');
// Set the global key's default value to the window object
globals.initialize('global', window);

Setting a dynamic Property

@imaustink
imaustink / Modernizr.flexbox.js
Last active August 24, 2017 16:26
A build of Modernizr.flexbox that has been formatted by jsnice.org
!function(win, d, obj) {
/**
* @param {string} obj
* @param {string} type
* @return {?}
*/
function is(obj, type) {
return typeof obj === type;
}
/**
@imaustink
imaustink / readme.js
Last active March 1, 2019 19:33 — forked from andrejewski/license-year.js
Super mod: Update readme
var fs = require('fs');
var path = require('path');
var MODULE_DESC_REGEX = /<code>__can-.+__ <\/code>\n(.+)/m;
var FALLBACK_MODULE_DESC_REGEX = /(?=\n[a-z]|\n[A-Z])\n(.+)/m
module.exports = {
getOptions: function () {
return [];
},
@imaustink
imaustink / abolish-bit-docs.js
Last active August 24, 2017 22:25
Removes bit-docs from can-* projects
var fs = require('fs');
var path = require('path');
module.exports = {
getOptions: function () {
return [];
},
run: function (directory, opts) {
var promises = [];