Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / index.html
Created July 12, 2017 17:57
JS Bin // source http://jsbin.com/qanidipoze
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@Rich-Harris
Rich-Harris / service-workers.md
Last active July 10, 2024 17:04
Stuff I wish I'd known sooner about service workers

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.

@kellishouts
kellishouts / gulp_sass_livereload.md
Last active January 24, 2022 06:40
Gulp + Sass + LiveReload 1.0

Gulp + Sass + LiveReload

This Gist goes over setting up a gulp workflow that will:

  1. watch for any sass changes, then compiles sass source into css
  2. watch for any changes in the public directory, and trigger live-reload
  3. serve static content in public/

@thaenor
thaenor / application.js
Created February 25, 2015 15:43
jQuery example to update a form on focus
/*Content originally from CodeSchool's "try jQuery" lesson. http://try.jquery.com/levels/4/challenges/16 */
$(document).ready(function() {
/*
* this first part fetches the price and multiplies for the number input in the form
*/
$("#nights").on("keyup", function() {
var nights = +$(this).val();
var dailyPrice = +$(this).closest(".tour").data("daily-price");
$("#total").text(nights * dailyPrice);
$("#nights-count").text($(this).val());
@ojintoad
ojintoad / gist:c04cdb5880da604d0ad9
Last active August 29, 2015 14:15
My notes on attempting to set up HabitRPG on Fedora
@jboner
jboner / latency.txt
Last active July 29, 2024 12:48
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD