Skip to content

Instantly share code, notes, and snippets.

View jed's full-sized avatar

Jed Schmidt jed

View GitHub Profile
'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
"Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Bandersnatch!"
So rested he by the Tumtum tree,
And stood awhile in thought.
@jed
jed / handler.js
Created May 16, 2016 16:30
Break Bot: pushing AWS IoT button events to Slack
'use strict'
// for context, see https://twitter.com/jedschmidt/status/732244756491816960
const https = require('https')
const qs = require('querystring')
const WEBHOOK_PATH = '/services/YOUR_WEBHOOK_PATH_HERE'
const EVENTS_BY_CLICKTYPE = {
SINGLE : {emoji: ':coffee:', type: 'beverages'},
@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")
}
@jed
jed / bundle.js
Created August 28, 2015 19:48
Using iojs on AWS Lambda
import {join} from "path"
import browserify from "browserify"
import babelify from "babelify"
import archiver from "archiver"
let opts = {
standalone: "code",
// these are the API equivalent of --node
// https://github.com/substack/node-browserify/blob/master/bin/args.js#L67-L78
@jed
jed / test.js
Created August 20, 2015 21:12
lambda tester
import {resolve} from "path"
let [pathname, args] = process.argv.slice(2)
if (!pathname) {
console.log("Usage: npm run test <path-to-script> <event-json>")
process.exit()
}
let path = resolve(process.cwd(), pathname)
@jed
jed / uniqlo_needs_u.md
Last active August 29, 2015 14:16
UNIQLO NEEDS U!

UNIQLO logo

tl;dr: The [UNIQLO USA][] e-commerce team is looking for a design-oriented developer skilled in the arts of modern markup and style, but also comfortable with some PHP and JavaScript.


In this position, you will:

  • Create end-to-end responsive mockups of UNIQLO landing pages for upcoming product lines.
  • Work in-house with the visuals team to design experiences and assets that scale well across device sizes.
@jed
jed / plaque.md
Last active August 29, 2015 14:15
BrooklynJS "Sweet 0x10" Commemorative Plaque

[UPDATE] WE SOLD 'EM ALL, RAISING $2,625 for SCRIPTED!

It took a few months, but our experiment of upcycling our unused tokens into fundraising keepsakes finally paid off! It accomplished a whole lot of win in one fell swoop:

  • Creating a physical commemoration of the awesomeness that has been the NYC JavaScript community over the past two years.
  • Raising $2,625 for [ScriptEd][], a NYC-based organization that does amazing work in the local tech community.
  • Increasing BrooklynJS ticket availability through reserved ticket bundling.
  • Letting me work on a creative physical project with my pals @brianloveswords, @kosamari, and @philduffy.
  • Taking bags and bags of unused tokens out of my tiny Brooklyn walkup closets.

Keybase proof

I hereby claim:

  • I am jedschmidt on github.
  • I am jedschmidt (https://keybase.io/jedschmidt) on keybase.
  • I have a public key whose fingerprint is F1D6 924F 3B26 FB87 B488 2664 ED0D 4AE7 933C 4D2A

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am jedschmidt on github.
  • I am jedschmidt (https://keybase.io/jedschmidt) on keybase.
  • I have a public key whose fingerprint is F1D6 924F 3B26 FB87 B488 2664 ED0D 4AE7 933C 4D2A

To claim this, I am signing this object: