Skip to content

Instantly share code, notes, and snippets.

View Antoinebr's full-sized avatar
:octocat:
🔥

Antoinebr

:octocat:
🔥
View GitHub Profile
@Rich-Harris
Rich-Harris / service-workers.md
Last active June 6, 2024 22: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.

@LosantGists
LosantGists / esp8266-deep-sleep.ino
Created March 15, 2017 15:21
An example showing how to put a ESP8266 device into Deep-sleep mode
/**
* An example showing how to put ESP8266 into Deep-sleep mode
*/
void setup() {
Serial.begin(115200);
Serial.setTimeout(2000);
// Wait for serial to initialize.
while(!Serial) { }
@brunoleles
brunoleles / deb: command not found.md
Last active February 23, 2022 14:27
Add repository on Debian when "deb" command is not available

deb: command not found

This gist seems to be not working anymore

Possible alternative solution https://unix.stackexchange.com/a/508728 ( not tested )

The Problem

$> deb http://ftp.debian.org/debian jessie-backports main
@marteinn
marteinn / list.md
Last active April 20, 2021 22:00
Which sites are using Turbolinks?
@anthonytxie
anthonytxie / hodl20.py
Created March 24, 2018 21:01
Hodl 20 Rebalancing Algorithm
def calc_allocations(self, date, quantity, cap):
"""Figure out ideal allocations for a given date"""
# {
# coin_name: (percent_allocation, data)
# }
top_market = self.get_top_market(date, quantity)
total_cap = sum([coin.market_cap for coin in top_market])
allocations = [{
@iDVB
iDVB / docker-compose.yml
Last active October 24, 2018 00:51
WebPageTest local
version: "2"
services:
server:
image: webpagetest/server:latest
volumes:
- ./server/locations.ini:/var/www/html/settings/locations.ini
agent:
image: webpagetest/agent:latest
environment:
@johnsfuller
johnsfuller / hubspot-hubl.html
Created July 20, 2021 12:32
WordPress/PHP & HubSpot/HubL Comparison Cheat Sheet
<!-- 👇 Scroll down 👇 -->
{# variables #}
{% set my_variable = 'Hello world' %}
{# get variables from somewhere else #}
{% import 'path/to/hubl-variables.html' as site_vars %}
{{ site_vars.my_external_variable }}