Skip to content

Instantly share code, notes, and snippets.

View maxmckenzie's full-sized avatar

Max McKenzie maxmckenzie

View GitHub Profile
/* eslint-disable no-console */
import raven from 'raven';
/*
To Use
import logger from './logger';
logger.error('test error');
logger.debug('test debug');
logger.warning('test warning');
@maxmckenzie
maxmckenzie / .envrc
Created November 10, 2016 09:18
Use the current directories node modules and avoid installing node_modules globally `-g` with direnv
export PATH=$(npm bin):$PATH
@maxmckenzie
maxmckenzie / client.js
Last active August 14, 2018 17:12
Simple Socket.io example
// https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.6.0/socket.io.min.js
var socket = io('http://localhost:5050');
socket.on('news', function (data) {
console.log(data);
socket.emit('client event', { my: 'data' });
});
@maxmckenzie
maxmckenzie / gist:5111987d01ae30504b8e7c31758f9401
Created January 2, 2017 13:30
Allow apps from anywhere not just identified or app store
sudo spctl --master-disable
@maxmckenzie
maxmckenzie / App.vue
Last active February 1, 2017 19:57
Vue webpack Vue-router configuration (Standard JS Style)
// src/App.vue
<template>
<div>
<div class="menu">
<router-link :to=" { name: 'home' }">Home</router-link>
<router-link :to=" { name: 'auth' }">Auth</router-link>
</div>
<div id="app">
<router-view></router-view>
</div>
// Spread operirators baby
var Array = [[1, 2],[3, 4, 5], [6, 7, 8, 9]];
var result = [].concat(...Array);
console.log(result);
@maxmckenzie
maxmckenzie / grid.less
Created August 14, 2018 17:10
Flexbox Grid
/*
Grid and breakpoints
*/
@gutter-width: 0.5rem;
@outer-margin: 2rem;
@gutter-compensation: calc((@gutter-width * 0.5) * -1);
@half-gutter-width: calc((@gutter-width * 0.5));
@xs-bp:30rem;
@maxmckenzie
maxmckenzie / example.html
Last active October 3, 2018 11:47
Legacy sass grid system without flexbox, but also not using floats. Created for a project with IE9 support.
<div>
<div className="grid-row">
<div className="col _6 col-demo">col _6</div>
<div className="col _6 col-demo">col _6</div>
</div>
<div className="grid-row">
<div className="col _6">
<div className="grid-row">
<div className="col _6 col-demo">nested col _6</div>
<div className="col _6 col-demo">nested col _6</div>
@maxmckenzie
maxmckenzie / nightwatch-config.js
Created July 13, 2019 09:19
nightwatch config for cucumber and gherkin
// http://mucsi96.github.io/nightwatch-cucumber/
const seleniumServer = require('selenium-server')
const phantomjs = require('phantomjs-prebuilt')
const chromedriver = require('chromedriver')
require('nightwatch-cucumber')({
cucumberArgs: [
'--compiler', 'js:babel-core/register',
'--require', 'features/step_definitions',
'--require', 'features/hooks.js',
@maxmckenzie
maxmckenzie / gitlab-ci-yml
Created July 13, 2019 09:30
gitlab-ci-yml example config with sonar cube.
image: node:latest
stages:
- build
- test
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/