Skip to content

Instantly share code, notes, and snippets.

View yowainwright's full-sized avatar
👦
Dad life!

Jeff Wainwright yowainwright

👦
Dad life!
View GitHub Profile
@yowainwright
yowainwright / build.js
Created December 9, 2017 01:40
Build function, used for a Webpack abstraction in the wild
const build = () => {
return new Promise((resolve, reject) => {
compiler.run((err, stats) => {
if (err) return reject(err)
resolve(stats)
})
})
}
export { build }
@yowainwright
yowainwright / play-button.scss
Last active December 9, 2017 08:34
SCSS Play Button Mixin
@mixin play-button ($fontsize, $circlesize) {
position: relative;
&:after {
content: '▶';
display: block;
width: $circlesize;
height: $circlesize;
border-radius: 100%;
position: absolute;
left: calc(50% - #{$circlesize / 2});
@yowainwright
yowainwright / input-frequency.js
Created December 9, 2017 18:35
Input Frequency
switch (inputFrequency) {
case 1:
date = this.nextBillDateIsWithinOneMonth(nextBillDate) ?
moment(nextBillDate) : moment(nextBillDate).subtract(1, 'month')
break
case > initialFrequency:
newFrequencyDelta = (inputFrequency - initialFrequency)
date = moment(nextBillDate).add(newFrequencyDelta, 'month')
break
default:
@yowainwright
yowainwright / fav-colors.css
Last active December 9, 2017 19:50
Fav hex colors 🖍
/* usual suspects 👥 */
--blue: blue; /* yep, it's just the truth */
--redpink: #FB2743; /* I saw it on ASOS. I like what they're doing with blue. */
--floralwhite: #fffcf3 #fff floralwhite hsl(45,100,97)rgb(255,252,243); /* I saw it on Cosma Schema. */
/* off the beaten path, but weird and refreshing 👨‍🎨 */
--lightpurple: #E2D7FE;
--cartoonflesh: #FFAEA2;
--deeputramarine: #152783;
@yowainwright
yowainwright / ie-hack.scss
Last active December 9, 2017 19:52
Useful IE Hack SCSS Mixins
// target IE 10 and 11 with a media query
@mixin support-ie-10-11 {
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
@content
}
}
// hack for css styles for < ie 9 only
@mixin support-ie-9($property, $value) {
$property: #{$value + '\0/'};
@yowainwright
yowainwright / head.html
Last active December 10, 2017 00:18
Favicon Head Gist 🖼
<!-- android -->
<link rel="icon" type="image/png" sizes="192x192" href="/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/android-chrome-512x512.png">
<!-- apple -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<!-- favicon -->
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<!-- manifest -->
<link rel="manifest" href="/manifest.json">
@yowainwright
yowainwright / bold-list-headers.md
Last active December 12, 2017 19:07
Bold list headers with `.md`

Bold List Headers in Markdown

This is a test for the look of bold list headers in markdown.

The goal of this gist is to examine using <header> tags or <strong> tags.


List header that is bold with the <h4> tag.

  • List Header 1 code

@yowainwright
yowainwright / observer.js
Last active December 14, 2017 02:26
ES5/6 Observer 👀
/*
ES5/6 Observer 👀
---
- Like a promise (sort of) but will work in older browsers
- With Babel, this will transpile to something very similar to want is written
- Note the error
- both callback, err will return empty strings by default
- bool is false by default
*/
const observer = (bool = false, callback = () => '', iterator = 10, maxTime = 300, err = () => '') => {
@yowainwright
yowainwright / darn-characters-i-forget.md
Last active June 28, 2018 09:23
Darn characters I forget 🤷

Darn Characters I Forget 🤷

  • is the Command (cmd)() key

  • is the Control key

  • is the Option (alt) key

  • is the Shift key

  • is the Caps Lock key

  • fn is the Function key


@yowainwright
yowainwright / app.js
Last active November 3, 2022 20:41
load images with Promises from MPJ
import loadImage from 'loadImage'
const addImg = (src) => {
const imgEl = document.createElement('img')
imgEl.src = src
document.body.appendChild(imgEl)
}
const imgArr = [
loadImage('images/cat1.jpg'),
loadImage('images/cat2.jpg'),