Skip to content

Instantly share code, notes, and snippets.

Jed Schmidt jed

Block or report user

Report or block jed

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
@jed
jed / plaque.md
Last active Aug 29, 2015
BrooklynJS "Sweet 0x10" Commemorative Plaque
View plaque.md

[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.
View keybase.md

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:

View keybase.md

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:

View uuid_v4.js
var crypto = require("crypto")
module.exports = function() {
var bytes = crypto.randomBytes(16)
bytes[6] &= 0x0f // 0000xxxx
bytes[6] += 0x40 // 0100xxxx
bytes[8] &= 0x3f // 00xxxxxx
bytes[8] += 0x80 // 10xxxxxx
@jed
jed / README.md
Last active Dec 27, 2015
Use U+200B to evade Twitter's DM malware flagging
View README.md

Use this bookmarklet to escape the URL of the current page and evade Twitter's broken malware link flagging. It prepends all periods with a zero-width space, which Chrome, Firefox, and Safari all seem to ignore. Twitter's server won't recognize it as a link (yet), but the Twitter client will, which means it remains clickable in the DM pane.

For example: https://twitter.com/ will get flagged as malware in a DM, while https://twitter​.com/ won't. They look the same, but the latter has a ZWSP before the . in .com.

@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active Sep 21, 2019
How to set up stress-free SSL on an OS X development machine
View how-to-set-up-stress-free-ssl-on-os-x.md

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@jed
jed / monotonic-timestamp.js
Last active Dec 20, 2015
returns unique timestamps, delays subsequent calls if called more than once per millisecond.
View monotonic-timestamp.js
var then = Date.now()
function monotonicTimestamp(cb) {
var now = Date.now()
now > then
? setImmediate(cb, null, then = now)
: setTimeout(cb, then - now, null, ++then)
}
View when-to-include-an-article.txt
_ ___ _ ___ _ _ ___ _ _ ___ _ ___ ___ _ _
| | | __| /_\ | _ \ \| | | __| \| |/ __| | |_ _/ __| || |
| |__| _| / _ \| / .` | | _|| .` | (_ | |__ | |\__ \ __ |
|____|___/_/ \_\_|_\_|\_| |___|_|\_|\___|____|___|___/_||_|
@jed
jed / level-incremental-id.js
Last active Dec 17, 2015
an approach for incremental ids using levelup.
View level-incremental-id.js
var levelup = require("levelup")
var path = __dirname + "db"
var options = {encoding: "json"}
var db = levelup(path, options)
function id(cb) {
if (typeof cb != "function") throw new TypeError
if (!id.queue) {
id.queue = []
View install_local-tld_error.txt
$ npm -g install local-tld
npm http GET https://registry.npmjs.org/local-tld
npm http 304 https://registry.npmjs.org/local-tld
> local-tld@3.0.6 preuninstall /usr/local/lib/node_modules/local-tld
> ./bin/local-tld-uninstall
++ id -u
+ '[' 501 -eq 0 ']'
+ SUDO=sudo
You can’t perform that action at this time.