Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mcranston18 on github.
  • I am mcranston18 (https://keybase.io/mcranston18) on keybase.
  • I have a public key whose fingerprint is 91FF E601 E006 4CAF B916 DFAF 107E F6B4 3C9F 9F5E

To claim this, I am signing this object:

const Sequelize = require('sequelize');
const sequelize = new Sequelize('dummy_db', 'postgres', '', {
host: 'localhost',
dialect: 'postgres',
logging: false
});
const User = sequelize.define('users', {
id: {
### Keybase proof
I hereby claim:
* I am mcranston18 on github.
* I am mcranston18 (https://keybase.io/mcranston18) on keybase.
* I have a public key ASDuy0tvtWmb9ZdaZYljUD6mi8Fb57GQfvzNpjiDJvMjxAo
To claim this, I am signing this object:
@mcranston18
mcranston18 / testing.js
Created September 28, 2017 16:12
Component testing
describe('myComponent', function() {
var $ctrl;
var $rootScope;
var $scope;
beforeEach(module('theNameOfMyAngularApp'));
beforeEach(inject(function(_$rootScope_, _$componentController_) {
$rootScope = _$rootScope_;
$scope = $rootScope.$new();
{
"name": "root",
"children": [
{
"name": "Bacteria",
"children": [
{
"name": "Acidobacteria",
"children": [
{
@mcranston18
mcranston18 / config.js
Created September 16, 2016 15:27
ES6 babel/webpack build
'use strict';
var path = require('path');
var gulp = require('gulp');
var conf = require('./conf');
var browserSync = require('browser-sync');
var webpack = require('webpack-stream');
var $ = require('gulp-load-plugins')();
@mcranston18
mcranston18 / flex-grid.scss
Created November 25, 2015 18:00
Foundation V6 Flex Grid
.foundation-mq {
font-family: "small=0em&medium=40em&large=64em&xlarge=75em&xxlarge=90em"; }
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS and IE text size adjust after device orientation change,
* without disabling user zoom.
*/
html {
@mcranston18
mcranston18 / gist:b03514d1030396f24a3b
Last active August 29, 2015 14:21
generic semantic ui directive
/**
* semanticUi - Generic directive for Semantic UI Javascript initialization.
*/
'use strict';
angular.module('cozumo')
.directive('semanticUi', function ($timeout) {
return {
restrict: 'A',
var git = require('gulp-git');
var inject = require('inject-string');
var q = require('q');
var getHash = function() {
var deferred = q.defer();
$.git.revParse({args:'--short HEAD'}, function (err, hash) {
deferred.resolve(hash);
});
return deferred.promise;
var git = require('gulp-git');
var inject = require('inject-string');
// This successfully returns my git hash
gulp.task('hash', function() {
git.revParse({args:'--short HEAD'}, function (err, hash) {
return hash;
});)
})