(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* | |
| * CHALLANGE: | |
| * Cache `index.html` file using service worker. | |
| * | |
| * This bit of code is included in <script> tag of index.html | |
| * if (navigator.serviceWorker) { | |
| * navigator.serviceWorker.register('serviceworker.js', {scope: '/'}) | |
| * } | |
| * | |
| */ |
| #!/usr/bin/env python3 | |
| # This code demonstrates a code sequence that will cause the Python sqlite | |
| # to immediately generate a "database is locked" exception, even with a large | |
| # timeout | |
| import sqlite3 | |
| import time | |
| import threading |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // Simulate a call to Dropbox or other service that can | |
| // return an image as an ArrayBuffer. | |
| var xhr = new XMLHttpRequest(); | |
| // Use JSFiddle logo as a sample image to avoid complicating | |
| // this example with cross-domain issues. | |
| xhr.open( "GET", "http://fiddle.jshell.net/img/logo.png", true ); | |
| // Ask for the result as an ArrayBuffer. | |
| xhr.responseType = "arraybuffer"; |
| /usr/bin/pdfjam --landscape --suffix book --a4paper --trim '1cm 1cm 1cm 1cm' --clip 'true' --signature '32' -- input.pdf - |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
(The below text is licensed with CC0, which means that if you want to use or translate it, that is OK by me.)
Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺
Locally, I'm at this commit:
$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date: Sun Apr 15 16:35:03 2012 +0200
| server { | |
| listen 80; | |
| server_name localhost; | |
| # ... other default site stuff, document root, etc. ... | |
| location ~ ^/~(?<userdir_user>.+?)(?<userdir_uri>/.*)?$ { | |
| alias /home/$userdir_user/public_html$userdir_uri; | |
| index index.html index.htm index.php; | |
| autoindex on; |