Skip to content

Instantly share code, notes, and snippets.

Working from home

Eric Clemmons ericclemmons

Working from home
Block or report user

Report or block ericclemmons

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View machine.js
// This state machine is trying to figure out how to allow a user to call `await Auth.getUser()` multiple times throughout their app and get the current user once it resolves.
// Utility to resolve a Promise externally
const defer = () => {
let res,rej;
const promise = new Promise((resolve, reject) => {
res = resolve;
rej = reject;
ericclemmons / responsive-badge.html
Created May 28, 2019
Responsive indicators for TailwindCSS
View responsive-badge.html
<link rel="stylesheet" href="">
<!-- Responsive indicators! -->
<div class="fixed top-0 right-0 z-50 bg-pink-500 text-white shadow-md px-2 rounded-bl font-mono">
<span class="sm:hidden">default</span>
<span class="hidden sm:inline md:hidden">sm</span>
<span class="hidden md:inline lg:hidden">md</span>
<span class="hidden lg:inline xl:hidden">lg</span>
<span class="hidden xl:inline">xl</span>
ericclemmons /
Created Apr 15, 2018
Hot take on Zach Silveira's Gutenblock Demo!
ericclemmons / webpack.config.js
Created Nov 22, 2016
Minimal webpack + babel + Node v6 + Chrome
View webpack.config.js
var webpack = require("webpack");
module.exports = {
module: {
loaders: [
exclude: /node_modules/,
loader: "babel-loader",
query: {
cacheDirectory: true,
ericclemmons / snazzy.itermcolors
Created Sep 17, 2016
Port of hyperterm-snazzy to iTerm2
View snazzy.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<key>Ansi 0 Color</key>
<key>Alpha Component</key>
<key>Blue Component</key>
ericclemmons /
Last active Mar 21, 2020
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

 <summary>Summary Goes Here</summary>
ericclemmons / schools.address.state.js
Created Jun 12, 2016
Term for: schools.address.state (Stores the state abbreviation for a school's location)
View schools.address.state.js
* Term: schools.address.state
* Stores the state abbreviation for a school's location.
module.exports = {
table: 'school', // Entity table in DB
// `?state=tx` is supported (or would throw) here
filter: function(qb, value) {
View webpack.config.babel.js
export default {
resolve: {
root: [
path.join(process.cwd(), "lib"),
ericclemmons / HappyFactory.js
Created Aug 27, 2015
ES6 Classes as Factories
View HappyFactory.js
class HappyFactory {
constructor(message) {
return Promise.resolve(`${message} there!`);
new HappyFactory("Howdy").then(::console.log);
// "Howdy there!"
View webpack.config.base.js
var _ = require("lodash");
var path = require("path");
var env = process.env.NODE_ENV || "development";
var debug = ["development", "test"].indexOf(env) !== -1;
var defaults = {
cache: debug,
debug: debug,
You can’t perform that action at this time.