Skip to content

Instantly share code, notes, and snippets.

Morgan Intrator morgs32

Block or report user

Report or block morgs32

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@morgs32
morgs32 / gulpfile.js
Created May 24, 2015
This gulp file will create svg iconsets out of material icons to use with $mdIconProvider in angular-material
View gulpfile.js
//to use in angular-material as described here: https://material.angularjs.org/latest/#/api/material.components.icon/service/$mdIconProvider
//the icons you get from bower install material-design-icons
var gulp = require('gulp');
var tap = require("gulp-tap");
var path = require("path");
var fs = require('fs-extra');
var replaceAll = function(s, target, replacement) {
@morgs32
morgs32 / css-best-practices.md
Last active Jul 11, 2016
CSS Best Practices
View css-best-practices.md

No css on tags (h2, h4, etc) almost all CSS methologies recommend flat structures in the vein of:

View expandableTable.scss
.expandableTable {
margin-bottom: 0;
margin-top: -36px;
composes: table from './tables.scss';
background: #eee;
}
@morgs32
morgs32 / until.js
Created Jul 24, 2017 — forked from matthieuprat/ README.md
Until operator for Enzyme's shallow wrapper
View until.js
export default function until(selector, {context} = this.options) {
if (this.isEmptyRender() || typeof this.node.type === 'string')
return this
const instance = this.instance()
if (instance.getChildContext) {
context = {
...context,
...instance.getChildContext(),
}
@morgs32
morgs32 / cssTransform.js
Created Mar 28, 2018
To enable jest snapshots to imitate CSS module classnames
View cssTransform.js
'use strict';
// This is a custom Jest transformer turning style imports into empty objects.
// http://facebook.github.io/jest/docs/tutorial-webpack.html
const path = require('path');
module.exports = {
process(src, filename, config, options) {
return `
View Async error handling
async function startTask(req) {
const {
params: {
userId,
},
} = req;
const user = await getUser(userId)
.catch((e) => {
You can’t perform that action at this time.