Skip to content

Instantly share code, notes, and snippets.

@ungoldman
ungoldman / choo-store.js
Last active July 24, 2018 09:24
sketch of a simple wrapper for predictable, namespaced choo stores
/*
Now a real module used in production!
https://github.com/ungoldman/choo-store
*/
class Store {
constructor (opts) {
opts = opts || {}
@jed
jed / progress.js
Last active March 11, 2016 08:37
Using template strings as progress bars
"use strict"
function progress(strs, current, total) {
let str = `${strs[0]}${current}${strs[1]}${total}${strs[2]}`
let ratio = Math.min(Math.max(current / total, 0), 1)
let length = Math.floor(ratio * str.length)
let pattern = new RegExp(`^.{${length}}`)
return str.replace(pattern, "\x1b[4m$&\x1b[0m")
}
@nolanlawson
nolanlawson / citizen.md
Last active February 19, 2019 12:38
How to be a good open-source citizen

How to be a good open-source citizen

A short list of tips and recommendations, for those who use OSS and/or want to contribute to it.

  1. Give feedback

Before I get into the wrong ways to give feedback, let me be clear: the worst thing you can do is give no feedback at all.