Skip to content

Instantly share code, notes, and snippets.

View zephraph's full-sized avatar

Justin Bennett zephraph

View GitHub Profile
@zephraph
zephraph / SassMeister-input-HTML.html
Created February 13, 2016 18:53
Generated by SassMeister.com.
<div class="capsule">
<header class="capsule__header">
<h1 class="capsule__headline">What We're Loving Now</h1>
<a class="capsule__cta" href="#">See More!</a>
<p class="capsule__description">A few of the things we like</p>
</header>
<section class="capsule__content">
@zephraph
zephraph / SassMeister-input-HTML.html
Created February 13, 2016 19:06
Generated by SassMeister.com.
<div class="capsule">
<header class="capsule__header">
<h1 class="capsule__headline">What We're Loving Now</h1>
<a class="capsule__cta" href="#">See More!</a>
<p class="capsule__description">A few of the things we like</p>
</header>
<section class="capsule__content">
@zephraph
zephraph / streamify.js
Created August 19, 2016 03:54
Streamify the things
const streamify = (tree) =>
pipe(
keys,
filter(key => tree.hasOwnProperty(key)),
map(key => ({
[`${key}$`]: typeof tree[key] === 'function' && typeof tree[key].then === 'function'
? (...args) => K.fromPromise(tree[key].apply(null, args))
: typeof tree[key] === 'object'
? streamify(tree[key])
: tree[key]
@zephraph
zephraph / pre-commit
Last active March 11, 2018 03:40
Git hook for automatically switching between work/oss accounts depending on the directory
#!/usr/bin/python
# This file should live at ~/.git/hooks
import os
from subprocess import call
if "git/work" in cwd:
print "Using work account"
call("git config user.name <Your name>", shell=True)
### Keybase proof
I hereby claim:
* I am zephraph on github.
* I am zephraph (https://keybase.io/zephraph) on keybase.
* I have a public key ASD1RxP1w5y9jQgHhB6PxWD5KmyzeRSyO0CG2C4gMdiAFQo
To claim this, I am signing this object:
@zephraph
zephraph / SketchSystems.spec
Last active January 14, 2019 21:15
TabTimerState
TabTimerState
NotStarted
tabActivated -> SetTimer
TabTimerTicking
tabDeactivated -> TimerPaused
timerExpired -> TimerWaitingToReset
timerReset -> TabTimerTicking
deactivateTimers -> NotStarted
TimerPaused
tabActivated -> TabTimerTicking
@zephraph
zephraph / clean_node_modules.sh
Last active June 13, 2023 13:53
A shell script to clean up all node_modules in projects that haven't been touched in a couple weeks.
#!/bin/bash
DAYS_SINCE_LAST_CHANGE=14 # If a project hasn't been touched in this long its node_modules will be deleted
SEARCH_PATH="./Git" # Update this to the path where your code is stored
TOTAL_BYTES_REMOVED=0
Mb=1000000
Kb=1000
node_modules=$(find $SEARCH_PATH -name "node_modules" -type d -prune)
@zephraph
zephraph / colors.txt
Created July 3, 2019 03:32
Color test range
#000000
#000f17
#001e1c
#002b00
#0037ca
#004473
#005160
#005e53
#006b3d
#007800
@zephraph
zephraph / fetch-colors.js
Last active July 3, 2019 17:31
Github label color scrape
// Uses wdio to run
const fs = require("fs");
const colors = fs
.readFileSync("./colors.txt")
.toString()
.split("\n");
const pages = colors.map(color => `https://github.com/zephraph/test/labels/preview/TEXT?color=${color.slice(1)}`);
@zephraph
zephraph / parse-colors.js
Last active July 3, 2019 17:22
Parsed GitHub label colors
const fs = require("fs");
const fromRGB = require("@fantasy-color/from-rgb").default;
const hex = color => color.toString(16).padStart(2, "0");
const rgbToHex = rgb => {
const { red, green, blue } = fromRGB(rgb);
return `#${hex(red)}${hex(green)}${hex(blue)}`;
};
const colors = fs