Skip to content

Instantly share code, notes, and snippets.

View moimikey's full-sized avatar
:shipit:
ship it

Michael Scott Hertzberg moimikey

:shipit:
ship it
View GitHub Profile
@moimikey
moimikey / colors.js
Last active August 23, 2022 17:08
colors!
var colors = {
indigo: "#4b0082",
gold: "#ffd700",
hotpink: "#ff69b4",
firebrick: "#b22222",
indianred: "#cd5c5c",
yellow: "#ffff00",
mistyrose: "#ffe4e1",
darkolivegreen: "#556b2f",
olive: "#808000",
@moimikey
moimikey / web-application-stack.md
Last active September 29, 2021 15:32
web-application-stack.md

Packages

dependencies

  • Apollo
  • Babel
  • Serverless or CDK
  • GraphQL
  • MobX
  • MobX State Tree
  • NextJS
echo starting antigen...
source /usr/local/share/antigen/antigen.zsh
antigen init $HOME/.antigenrc
export EDITOR="vim"
export HISTSIZE=9999999999
export LANG="en_US.UTF-8"
export NVM_DIR="$HOME/.nvm"
export SSH_KEY_PATH="$HOME/.ssh/id_rsa"
export JAVA_HOME=$(/usr/libexec/java_home)
❯ npm s /\^gulp- htdocs/git/master
NAME DESCRIPTION AUTHOR
gulp-6to5 Turn ES6 code into vanilla ES5 with no runtime required =sindresorhus…
gulp-9-patch Utilities for android-9-patch images. =manse
gulp-a11y A Gulp plugin for a11y to run accessibility audits on html… =mpezzi
gulp-absolute Filter files by absolute path =jeromedecoster
gulp-absolute-image =spud
gulp-absurd AbsurdJS plugin for Gulp =krasimir
gulp-accord a unified interface to compiled javascript languages =jenius
gulp-acss
@moimikey
moimikey / coerce.js
Last active April 27, 2019 13:51
30 bytes to coerce "23" to Number, keep "apple" as String
/**
* function coerce(x) {
* return ''+x===x?(p=~~+x?r=+x:r=x):r=x
* }
* > undefined
* coerce(123)
* > 123
* coerce('123')
* > 123
* coerce('apple')
@moimikey
moimikey / deepFlat.js
Created March 31, 2019 16:04
deep flatten array in javascript
export const deepFlat = (arr) => arr.flat(Infinity)
@moimikey
moimikey / README.md
Last active May 29, 2018 12:57
inline props as styled-component css

@moimikey

Usage

// valid css properties in camelCase (checked by `css-key`)
const props = {
  gridColumnStart: ...,
 gridColumnEnd: ...,
@moimikey
moimikey / a.js
Created January 6, 2018 17:20
filter out only `on` event props from react component
// ...
renderMenu() {
const { children, ...rest } = this.props || {};
// only store props that startWith `on` in case the parent component
// wants to send event callbacks down, for subsequent use.
const eventProps = Object.keys(rest)
.filter(key => key.substr(0, 2) === 'on') // if startsWith 'on' (ie. onMouseOver)
.reduce((obj, key) => Object.assign(obj, { [key]: rest[key] }), {});
// ...
@moimikey
moimikey / config.js
Created October 21, 2014 01:29
ultimate webpack config. work in progress...
module.exports = {
port: 8000,
globals: {
$: 'jquery',
jQuery: 'jquery',
_: 'lodash',
Backbone: 'backbone',
Marionette: 'backbone.marionette',
moment: 'moment'
},
"use strict";
const assert = require('assert') // for tests
const deparam = url => {
const decodeUri = global.decodeURIComponent
const reduce = Array.prototype.reduce
const query = url.substr(url.indexOf('?') + 1).split('&')
return reduce.call(query, (memo, keyValue) => {
let key = keyValue.substr(0, keyValue.indexOf('='))