Skip to content

Instantly share code, notes, and snippets.

View webdeveloperninja's full-sized avatar
💭
hakuna matata

Robert Smith webdeveloperninja

💭
hakuna matata
View GitHub Profile
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 21, 2024 16:24
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.

@Protoneer
Protoneer / SerialEcho
Created September 18, 2014 18:51
Serial Echo On Arduino
/*
* serial_echo.pde
* -----------------
* Echoes what is sent back through the serial port.
*
* http://spacetinkerer.blogspot.com
*/
int incomingByte = 0; // for incoming serial data
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});