Skip to content

Instantly share code, notes, and snippets.

View ScreamZ's full-sized avatar

Andréas Hanss ScreamZ

View GitHub Profile
@addyosmani
addyosmani / workbox.md
Last active January 20, 2024 16:14
Workbox recipes

Workbox runtime caching recipes

Your Service Worker script will need to import in Workbox and initialize it before calling any of the routes documented in this write-up, similar to the below:

importScripts('workbox-sw.prod.v1.3.0.js');
const workbox = new WorkboxSW();

// Placeholder array populated automatically by workboxBuild.injectManifest()
@loilo
loilo / bubble.md
Last active April 27, 2023 00:21
Make Vue events bubble

Make Vue events bubble

Vue events don't bubble the component tree on their own. However when writing wrapper components this can be the desired behaviour.

This code registers a global bubble directive which allows to re-emit all given events:

Let's say we want to bubble events start, accelerate and brake of our component Car.

Without any help, we'd roughly have to do this:

@cecilemuller
cecilemuller / launch.json
Last active May 12, 2026 19:52
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Example",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
@patmigliaccio
patmigliaccio / now-secrets-json.js
Created May 12, 2019 01:23
Adds secret keys from local JSON files as Base64 to `now` secrets.
const fs = require('fs');
const GOOGLE_APPLICATION_CREDENTIALS = 'keys/google_application_credentials.json';
/**
* Adds secret keys from local JSON files as Base64 to `now` secrets.
*
* e.g. `node now-secrets-json.js'
*/
function main() {
@beatfactor
beatfactor / 01 – Running serialport in Docker with node alpine.md
Last active March 20, 2023 15:21
Running serialport in Docker with node alpine

When attempting to build the awesome serialport NPM package in Docker using a node alpine image, in usually failes on building the node-gyp package.

There are various workarounds which can be found online, such as this one.

However, the key ingredient is building the serialport package from source, using this line:

npm install serialport --build-from-source=serialport
@nebhead
nebhead / CustomUSBName.md
Last active May 8, 2026 20:15
Instructions for Adding Custom Naming for Arduino USB Device

The following is capturing instructions on how to add custom naming for an Arduino Leonardo (or generic pro-micro) for my Arcade Controller device. I wanted to have a simple record so that when I inevitably come back to this someday I can recall how I accomplished this. Reference was taken from the following YouTube video (https://youtu.be/hoCOq9Ngp44?t=1156) at approximately 19m16s.

WINDOWS Instructions:

Create a new set of folders: ~\Documents\Arduino\hardware\daemonbite\avr

Copy everything from C:\Program Files (x86)\Arduino\hardware\arduino\avr to this new folder.