Skip to content

Instantly share code, notes, and snippets.

View iest's full-sized avatar

Iestyn Williams iest

View GitHub Profile
const path = require('path');
const glob = require('glob');
// Setup babel so all future `require` calls are run through it
require("babel-register")({
// Override babel's default behaviour of ignoring all `node_modules`
ignore: false,
only: [
// Include all js/jsx files in ./src
"./src/**/*",
@iest
iest / cleanup-svg.js
Created September 6, 2016 16:15
Couple utility functions to cleanup SVGs (especially from Sketch output)
// https://gist.github.com/MoOx/1eb30eac43b2114de73a
const generic = {
title: /<title>.*<\/title>/gi,
desc: /<desc>.*<\/desc>/gi,
comment: /<!--.*-->/gi,
defs: /<defs>.*<\/defs>/gi,
width: / +width="\d+(\.\d+)?(px)?"/gi,
height: / +height="\d+(\.\d+)?(px)?"/gi,
sketchMSShapeGroup: / +sketch:type=\"MSShapeGroup\"/gi,
sketchMSPage: / +sketch:type=\"MSPage\"/gi,
@iest
iest / readme.md
Created November 29, 2016 18:26
How we went from css modules & sass to glamor

We started out with sass files with something like this (obvious brevity is obvious):

// colors.scss
$green: #37ab2e;
$white: #FFFFFF;

// skin.scss
.bg_green { color: $green; }
.fg_white { color: $white; }
@iest
iest / readme.md
Last active December 4, 2024 05:24
Moving from lodash/fp to ramda

Moving from lodash/fp to ramda

How

Good news is we're only using lodash/fp, which makes it easier to match function signatures.

  1. Find most-used lodash methods, we'll convert these first maybe?
  2. Go through each lodash method, find the ramda equivalent where possible
  3. Write a codemod to rewrite those usages
  4. Who the fuck thought function aliases were a good idea
@iest
iest / str.js
Created April 3, 2019 09:30
react context string-adder
// @flow
import * as React from 'react';
import * as R from 'ramda';
const SEPARATOR = '.';
const spaceToHyphen = R.replace(/\s/g, '-');
const delimit = (str, add) =>
R.compose(
R.join(SEPARATOR),
R.map(