Skip to content

Instantly share code, notes, and snippets.

View floer32's full-sized avatar

Michael Floering floer32

  • 03:23 (UTC -08:00)
View GitHub Profile
@Rich-Harris
Rich-Harris / service-workers.md
Last active December 3, 2025 11:09
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.

@ericclemmons
ericclemmons / example.md
Last active October 13, 2025 15:16
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@kevinkyyro
kevinkyyro / bloodvessels
Last active November 21, 2016 13:23
The_Force shaders
float square(float t) {
return step(0.0, sin(t));
}
void main () {
vec2 uv = uv();
vec2 uvN = uvN();
vec3 c = black;
float t = time / 24.;
@grubernaut
grubernaut / README.md
Last active September 27, 2020 17:57
Blue Green Deploys with Terraform

Terraform Blue-Green Deploy example

Note: Use Terraform Modules as functions!!!

This will allow you to create a "networking" module, and use those outputs to populate the security groups, access zones, and subnet id's for your other modules.

Using autoscaling groups with a fixed size will protect you from AWs bugs or instance outages. This way an instance that dies, will be replaced so you always maintain the expected amount of instances for that service.

Workflow:

@singingwolfboy
singingwolfboy / flask_csrf_test_client.py
Last active September 21, 2024 23:28
Want to run your Flask tests with CSRF protections turned on, to make sure that CSRF works properly in production as well? Here's an excellent way to do it!
# Want to run your Flask tests with CSRF protections turned on, to make sure
# that CSRF works properly in production as well? Here's an excellent way
# to do it!
# First some imports. I'm assuming you're using Flask-WTF for CSRF protection.
import flask
from flask.testing import FlaskClient as BaseFlaskClient
from flask_wtf.csrf import generate_csrf
# Flask's assumptions about an incoming request don't quite match up with
@ErosLever
ErosLever / owasp-risk-rating.html
Last active December 1, 2025 17:31
This is a quick and dirty OWASP Risk Rating Calculator. (demo: https://tinyurl.com/owasp-calculator )
<!-- access this at: https://tinyurl.com/owasp-calculator -->
<html><head>
<style>
@import url('https://fonts.googleapis.com/css?family=Palanquin:400,700&display=swap');
html {
font-size: 16px !important;
}
body {
background-color: #000;
/* background-image: url(https://www.securenetwork.it/assets/images/bg-black.png); */
package main
import (
"crypto/tls"
"flag"
"fmt"
"golang.org/x/net/html"
"io"
"log"
"net"
@vasanthk
vasanthk / System Design.md
Last active December 13, 2025 18:51
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@bishboria
bishboria / springer-free-maths-books.md
Last active November 28, 2025 17:29
Springer made a bunch of books available for free, these were the direct links
(def store (atom {:listViewA {:page 0 :records []}
:listViewB {:page 0 :records []}}))
(defn action-next-page [listview-state]
(update-in listview-state [:page] inc))
(action-next-page {:page 0 :records []})
;=> {:page 1, :records []}