Skip to content

Instantly share code, notes, and snippets.

View nucliweb's full-sized avatar

Joan León nucliweb

View GitHub Profile
@pragdave
pragdave / clapperboard.js
Created April 18, 2020 23:00
Trivial JS function to help sync sound and screen when recording a browser based screencast
export function clapperBoard() {
let audio = new AudioContext()
let beep = audio.createOscillator()
let flash = document.createElement("div")
beep.frequency.value = 440 * 5
beep.connect(audio.destination)
flash.classList.add("clapperboard")
beep.start()
@witmin
witmin / ffmpeg-mp4-to-animated-webp.md
Last active June 15, 2025 15:38
Convert MP4 file to animated WebP in ffmpeg

Convert MP4 file to animated WEBP file in ffmpeg CLI

1. Install ffmpeg CLI through homebrew

In terminal.app, install ffmpeg through homebrew

brew install ffmpeg

Validate the installation:

@anniesullie
anniesullie / CumulativeLayoutShiftBookmarklet.js
Last active February 13, 2023 07:52
Bookmarklet for showing Cumulative Layout Shift
/**
* A bookmarklet for viewing shifted elements while debugging
* Cumulative Layout Shift (web.dev/cls). Works in Chrome 84+
* Shows the previous position of shifted elements in yellow,
* and the new position in red.
*
* To install:
* 1. Copy the code starting from the line beginning `javascript:`
* 2. Add a new bookmark in Chrome, and paste the code in as the URL.
**/
@tkadlec
tkadlec / perf-diagnostics.css
Last active March 20, 2025 08:41
CSS used to highlight potential performance issues
:root {
--violation-color: red; /* used for clear issues */
--warning-color: orange; /* used for potential issues we should look into */
}
/* IMAGES */
/*
* Lazy-Loaded Images Check
* ====
@JoseJPR
JoseJPR / rxjs-custom-observable-and-operators.js
Last active September 19, 2021 06:57
🏗️ How to create Custom Observable and Operators with RxJS and Node.js. 👀 With this example I want to show how you can generate custom Observables and Operators with RxJS and Node.js.
/**
* Title: How to create Custom Observable and Operators with RxJS and Node.js.
*
* Description: With this example I want to show how you can generate custom
* Observables and Operators with RxJS and Node.js.
*/
import { Observable } from 'rxjs';
import { request } from 'undici';
@ChevyRay
ChevyRay / qoi.rs
Created November 24, 2021 22:49
QOI - Quote OK Image Format (Rust Port)
const INDEX: u8 = 0x0;
const RUN_8: u8 = 0x40;
const RUN_16: u8 = 0x60;
const DIFF_8: u8 = 0x80;
const DIFF_16: u8 = 0xc0;
const DIFF_24: u8 = 0xe0;
const COLOR: u8 = 0xf0;
const MASK_2: u8 = 0xc0;
const MASK_3: u8 = 0xe0;
@sts10
sts10 / rust-command-line-utilities.markdown
Last active July 7, 2025 16:53
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
/*
* Mando pasadiapositivas (siguiente y anterior) por
* bluetooth, usando dos botones del Lolin32 (ESP32)
*/
#include <Bounce2.h>
#include <BleKeyboard.h>
#define PREV_GPIO 4
#define NEXT_GPIO 23
@giacomozecchini
giacomozecchini / bfcachetest.js
Last active April 21, 2022 06:55
This script checks if a page is bfcache eligible and prints reasons if it isn't. It can be easily modified to check multiple pages.
// This script checks if a page is bfcache eligible and prints reasons if it isn't.
// It can be easily modified to check multiple pages.
// Chrome crbug: https://bugs.chromium.org/p/chromium/issues/detail?id=1312486
// Puppeteer issue: https://github.com/puppeteer/puppeteer/issues/8182
const puppeteer = require('puppeteer');
(async () => {
// Configuring and launching the browser
@PaulJuliusMartinez
PaulJuliusMartinez / record-screen-timelapse.rb
Created April 8, 2022 16:58
Simple macOS script for taking screenshots every X seconds on multiple displays
#! /usr/bin/env ruby
require 'time'
def usage
puts "USAGE: ./record-timelapse every 10 displays 1,2"
end
if ARGV[0] != "every" || ARGV[2] != "displays"
usage