Skip to content

Instantly share code, notes, and snippets.

View thesparrow's full-sized avatar
🏠
Working from home

Anna thesparrow

🏠
Working from home
  • Los Angeles
View GitHub Profile
@thesparrow
thesparrow / notify-user-of-update.js
Created February 17, 2018 00:51
This snippet shows to to notify user when updates are available using a service worker
//Offline Web Applications course on Udacity : Grow with Google Application Course
//code is placed in the controller file - not in the service worker itself
IndexController.prototype._registerServiceWorker = function () {
if (!navigator.serviceWorker) return; //feature detection
var indexController = this;
navigator.serviceWorker.register('/sw.js').then(function (reg) {
//if no controller found - latest version is already loaded
@thesparrow
thesparrow / mouseOver
Created February 1, 2015 20:32
Data visualization with D3
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
</head>
<body>
<div id= "intro">
<p> Our first introduction to data visualization </p>
</div>
<div id="viz"></div>
@thesparrow
thesparrow / Hi.py
Created January 23, 2015 04:28
Hello World
import python
print "Hello World!"