Skip to content

Instantly share code, notes, and snippets.

View ladyrassilon's full-sized avatar

Gemma Hentsch ladyrassilon

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

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.

@mbox
mbox / Dualcache
Last active September 3, 2019 16:14
Two-level cache for Django
To use the two-layer cache:
* Run memcached on each Django webserver
* Add "LOCAL_CACHE_ADDR = ('127.0.0.1:11211',)" to settings.py
* Replace "from django.core.cache import cache" with "from dualcache import cache" everywhere
you want to use the two-layer cache. It can be freely mix and matched with Django's default caching.