Skip to content

Instantly share code, notes, and snippets.

View 0xc0392b's full-sized avatar
🍊
fruity

william santos 0xc0392b

🍊
fruity
View GitHub Profile
@0xc0392b
0xc0392b / userChrome.css
Created August 5, 2023 05:43
Firefox userChrome style
/* Hide folder icons in bookmarks bar */
toolbarbutton.bookmark-item[type="menu"] .toolbarbutton-icon {
display: none !important;
}
@0xc0392b
0xc0392b / nftables.conf
Created March 20, 2023 08:32
nftables ruleset for secure home router with VPN
#!/usr/sbin/nft -f
# based on
# https://wiki.nftables.org/wiki-nftables/index.php/Simple_ruleset_for_a_home_router
# https://www.ivpn.net/knowledgebase/linux/linux-how-do-i-prevent-vpn-leaks-using-nftables-and-openvpn/
# reset
flush ruleset
# devices
@0xc0392b
0xc0392b / cf_images_upload.py
Last active March 20, 2023 08:33
Bulk upload to Cloudflare images
from tqdm import tqdm
from glob import glob
from requests import post
from argparse import ArgumentParser
"""
requires
requests>=2.28.2
tqdm>=4.64.1
@0xc0392b
0xc0392b / spoke_length.py
Last active December 4, 2022 23:22
Calculate bike wheel spoke length
from math import sin, cos, sqrt, pi
PI2 = pi * 2
spoke_count = 36
cross_pattern = 2
spoke_hole_diameter = 2 # in mm
DL = 89.8 # diameter of all the spoke holes in the left flange, measured centre to centre
LFO = 17.5 # distance from the lock nut to the centre of the left flange
@0xc0392b
0xc0392b / collage.py
Last active July 15, 2022 21:24
PIL collage script
from time import time
from math import ceil
from json import loads
from PIL.Image import new as new_image
from PIL.Image import open as open_image
from PIL.ImageDraw import Draw
from PIL.ImageFont import truetype
@0xc0392b
0xc0392b / 6ic.js
Last active November 16, 2021 12:36
6 instruction assembly language simulator written in Javascript using only arrow functions and ternary operators
/*
* @author William Santos
*
* Below is a 6 instruction assembly language simulator written in Javascript
* using only arrow functions and ternary operators.
* There is no point in an assembler here since the assembly program to be
* executed has to be composed as a recursive linked list of instructions
* - which are, of course, each constructed using explicit function calls.
*
* How it works: