This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Prints env vars from Netlify deploy settings UI to | |
* the JavaScript console. | |
* | |
* Usage: go to the build & deploy settings section of | |
* a Netlify site, then run this script. | |
*/ | |
const envVars = $("#section-environment").querySelectorAll("dl"); | |
const output = [].reduce.call(envVars, (str, dl) => { | |
const name = dl.querySelector("dt").innerText; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$color: #ffc107; | |
@debug lightness($color); | |
html { | |
background: lighten($color, 39.2%); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getResponseBreakpoint() { | |
const breakpoints = ['xl', 'lg', 'md', 'sm']; | |
return breakpoints.find((breakpoint) => { | |
const div = document.createElement("div"); | |
div.classList.add("d-none", `d-${breakpoint}-block`); | |
document.body.appendChild(div); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Replaces instances of @autobind decorators with a fat arrow function. | |
* | |
* !! **YMMV - only tested with ES6 class property member functions.** | |
* | |
* Given the following input: | |
* | |
* class MyClass { | |
* @autobind | |
* myAutoboundFunction() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STARTFONT 2.1 | |
COMMENT ter-u14n | |
FONT -xos4-Terminus-Medium-R-Normal--14-140-72-72-C-80-ISO10646-1 | |
SIZE 14 72 72 | |
FONTBOUNDINGBOX 8 14 0 -2 | |
STARTPROPERTIES 21 | |
FAMILY_NAME "Terminus" | |
FOUNDRY "xos4" | |
SETWIDTH_NAME "Normal" | |
ADD_STYLE_NAME "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "eslint:recommended", | |
"parser": "babel-eslint", | |
"env": { | |
"node": true, | |
"mocha": true, | |
"es6": true | |
}, | |
"rules": { | |
"import/default": 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { takeEvery } from 'redux-saga' | |
import { isFSA } from 'flux-standard-action' | |
const alreadyWarnedAbout = [] | |
export function* fsaCompliance() { | |
yield* takeEvery('*', function* checkCompliance(action) { | |
const { type } = action | |
if (!isFSA(action) && alreadyWarnedAbout.indexOf(type) === -1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { isFSA } from 'flux-standard-action' | |
function createFSAComplianceMiddleware() { | |
const alreadyWarnedAbout = [] | |
return ({ dispatch, getState }) => next => action => { | |
const { type } = action | |
if (!isFSA(action) && alreadyWarnedAbout.indexOf(type) === -1) { | |
// eslint-disable-next-line no-console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! AddPeerReviewerInitials(...) | |
" Go to the top of the file | |
execute ':normal gg' | |
" Find the first comment line, and go up one line | |
let lineIndex = search('^#') - 1 | |
" If line is blank, go up another one (my setup adds a new line when amending commit messages) | |
if !getline(lineIndex) | |
let lineIndex = lineIndex - 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
/* jwarby's JavaScript Style Guide | |
* v1.1.0 | |
* | |
* https://gist.github.com/75aeeab0793a60d14303 | |
* ===================================================== | |
*/ | |
/* | |
* ENVIRONMENTS |
NewerOlder