Skip to content

Instantly share code, notes, and snippets.

💎
Working from home

Jed Richards jedrichards

💎
Working from home
Block or report user

Report or block jedrichards

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
@Rich-Harris
Rich-Harris / service-workers.md
Last active Sep 16, 2019
Stuff I wish I'd known sooner about service workers
View service-workers.md

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@almost
almost / proposal.md
Last active Sep 12, 2019
Reactive 2016 Lightning Talk Proposal: Get Flow
View proposal.md

This is a proposal for a lightning talk at the Reactive 2016 conference.

NOTE: If you like this, star ⭐️ the Gist - the amount of stars decides whether it makes the cut! You could also Retweet if you want :)

Get Flow

Type checking JavaScript with Flow

JavaScript is a dynamic language, and there's nothing wrong with that. It allows quick iteration and lowers barriers. However, sometimes some compile-time type checking is just what you need to keep your code in line and give yourself the confidence to build bigger and faster. Flow gives the best of both worlds. You can have normal JavaScript but you can also add types where they're helpful, and it adds zero cost at runtime. In this talk I'll show Flow as it applies to a Redux & React codebase.

@almost
almost / async-await-lightning-talk.md
Last active Sep 12, 2019
Reactive 2015 Lightning Talk Proposal: Pyramids be gone!: ES7 Async Function
View async-await-lightning-talk.md

This is a proposal for a lightning talk at the Reactive 2015 conference.

NOTE: If you like this, star ⭐️ the Gist - the amount of stars decides whether it makes the cut! You could also Retweet if you want :)

Pyramids be gone!

ES7 Async Functions

JavaScript is getting async functions (or already has them if you count Babel.JS) and with them a way to finally slay the evil pyramid. This new language feature lets you write asynchronous code that almost looks synchronous, while maintaining the same semantics as promises. This lets you shed your .then and .catch boilerplate and escape those nested callbacks in favour of clean, explicit, maintainable code.

@jakub-g
jakub-g / npmrun
Last active Oct 20, 2018
Windows-compatible Bash autocompletion for `npm run` (for custom scripts defined in `package.json`)
View npmrun
`npmrun` gist provides bash autocompletion for `npm run` command.
It works on Windows with Git Bash, contrary to `npm completion`.
Currently it only works in the root of the repo.
You can’t perform that action at this time.