Skip to content

Instantly share code, notes, and snippets.

Firefox: default page zoom without extensions

Big thanks to SeriogaM for finding this out.

https://bugzilla.mozilla.org/show_bug.cgi?id=332275#c52

Background

Firefox by default doesn't have a preference for setting the default page zoom level so you need to use extensions or go changing zoom leven on per-page basis,

package main
import (
"encoding/binary"
"fmt"
"net"
"time"
)
type Packet struct {
/*
* Based on Obdev's AVRUSB code and under the same license.
*
* TODO: Make a proper file header. :-)
* Modified for Digispark by Digistump
*/
#ifndef __DigiKeyboard_h__
#define __DigiKeyboard_h__
#include <Arduino.h>
@bryanjhv
bryanjhv / fake-webcam
Created May 3, 2020 09:38
Create fake webcam for Raspberry Pi (3B+ tested)
#!/usr/bin/env sh
# REQUIRES BUILDING+INSTALLING THIS FIRST:
# https://github.com/umlaeute/v4l2loopback#install
NUM=${2:-0}
PIC=${1:-/usr/share/plymouth/themes/pix/splash.png}
if [ ! -r "$PIC" ]
then
@bryanjhv
bryanjhv / README.md
Created December 19, 2022 19:30
GPSD for GeoClue2 using NMEA over TCP

CLUE-NMEA-GPSD

GPSD for GeoClue2 using NMEA over TCP.

Installation

  1. Copy the XML file to /etc/avahi/services/nmea-0183.service.
  2. Run glue.py in order to start the service (listens on 10110/tcp).
  3. Optionally create a service (systemd or the like) for it to start at boot.
  4. Optionally disable all GeoClue2 sources except network-nmea to use GPS only.
// Simple Golang script for controlling Wiz light bulbs.
// It uses UDP discovery and makes it blink randomly.
package main
import (
"encoding/json"
"flag"
"fmt"
"log"
// Log custom tags used by running go root, and the files where they
// are used, so you can quickly see which tags can be used for
// specific behavior or just see, for example, which modules are CGo.
package main
import (
"fmt"
"go/scanner"
"go/token"
@bryanjhv
bryanjhv / jbadel.py
Created May 19, 2020 21:48
Delete JetBrains IDE Settings Sync (JBA Account) data
#!/usr/bin/env python3
# USAGE:
# 1. Download https://account.jetbrains.com/profile-details/JetBrainsPersonalData.xlsx
# 2. Open with Excel, go to Account sheet (default) and copy "Account ID" value (token)
# 3. Go to your IDE's folder and copy the "name" property from "product-info.json"
# 4. Run:
# export TOKEN=... # step 2
# export PRODUCT=... # step 3
# python3 jbadel.py
if __name__ == "__main__":
from datetime import datetime, timedelta
from smbus import SMBus
from sys import argv
from time import sleep
argc = len(argv)
bus = SMBus(1 if argc < 2 else int(argv[1]))
rop = "r" if argc < 3 else argv[2].lower()[0:1]
@bryanjhv
bryanjhv / Makefile
Created February 13, 2022 04:43
Golang multi-arch makefile
PLATFORMS := windows/386 windows/amd64 linux/386 linux/amd64 linux/arm linux/arm64
export CGO_ENABLED = 0
export GO386 = softfloat
parts = $(subst /, ,$@)
export GOOS = $(word 1,$(parts))
export GOARCH = $(word 2,$(parts))
export EXT = $(if $(filter windows,$(GOOS)),exe,bin)