Instantly share code, notes, and snippets.

View YouTubeEventHandling.js
let player
let onYouTubeIframeAPIReady
const youTubeReady = new Promise(resolve => {
var tag = document.createElement('script');
tag.src = "//";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

TimeHop Your Inbox Cares About Privacy!!

TimeHop Your Inbox only sees email information related to playing music!

When you visit TimeHop Your Inbox, your browser makes a direct connection to Gmail. You grant Gmail permission to share your data with the running web page, then the code can display info and play audio from your files.

At no point does the app look at the body of emails, nor does it send your info anywhere!

Architecture and Security

View background.js
//oauth2 auth
{'interactive': true},
//load Google's javascript client libraries
window.gapi_onload = authorize;
~src $ aws
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: too few arguments
~src $ aws help
~src $ mkdir haas
# Because of my current status, I dont have Haas credentials, and so a clone will fial
~haas $ ssh -T
logged in as deanius.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
~haas $ git clone
Cloning into 'haasapi'...
repository access denied.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
View observable-stream-3.js
// A non-streaming way to return Observable<User> from a URL
function fetchObservableOf(url) {
return new Observable(obs => {
fetch(url).then(data => {
data.users.forEach(user =>;
err => obs.error(err)
View observable-stream-2.js
function fetchObservableOf(url) {
return new Observable(obs => {
const stream = oboeGet(url)
stream.node("![*]", user =>
View observable-stream-1.js
user => addToList(user), // next
e => showModal(e), // error
() => hideSpinner() // complete

I like to ask of technical people:

In a situation like the following, must you retry the request and lose the data you'd already seen? Scenario: You make an AJAX request like /users, and the server returns all 100 of those users to you like [{},{},..., but the server dies before sending the final ]

I've heard many interesting answers. Leave yours in the comments! And generally they are "yes, that's the way it works" But I think the question is a distraction from the real issue: I think we used the wrong tool for the job. We sent the request over a document-oriented protocol (HTTP) instead of an incremental frame-oriented protocol and so we get document-oriented semantics (all-or-nothing) rather than list-oriented semantics (item, item, item..). Clear as crystal, right?

But as always on the internet, there are counter-arguments. Some will say - HTTP is just how we transfer stuff. Or I hear that WebSockets- a better fit for this problem of incremental delivery- are too hard to impl

View fs-write.js
"scratch/actors.yml", // file path
" - Scarlett Johansson", // text
"utf8" // encoding