Skip to content

Instantly share code, notes, and snippets.

@tobia
tobia / index.html
Created October 17, 2022 17:11 — forked from feo52/index.html
css hacks 2022
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
<title>css hack</title>
<style>
body { font-family: monospace; }
summary { list-style: none; }
summary::-webkit-details-marker { display:none; }
@tobia
tobia / YouTube - Hide Live Chat.js
Created November 29, 2021 19:52
YouTube - Hide Live Chat (by @lbmaian)
// ==UserScript==
// @name YouTube - Hide Live Chat
// @namespace https://gist.github.com/LazyMammal/1c60c45e9df26602f688d025f3b20f0c#gistcomment-3656586
// @version 0.4
// @description Hide live chat by default on live streams
// @author LM, bastiMQ, IrisNebula, lbmaian
// @match https://www.youtube.com/*
// @exclude https://www.youtube.com/embed/*
// @run-at document-end
// @grant none
@tobia
tobia / Japanese Dvorak.reg
Created April 22, 2021 17:25
Japanese IME with Dvorak
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000411]
"Layout File"="kbddvp.dll"
@tobia
tobia / gist:1ee850f521963eb811e6ee2097afa5bd
Created November 16, 2019 10:06
Hide Google "People also search for" and other stuff
.s + div, .exp-outline, .kno-kp, .mnr-c, .g-blk, #extrares
@tobia
tobia / gnome-terminal-bold-fonts.sh
Created June 9, 2019 14:04 — forked from arturfog/gnome-terminal-bold-fonts.sh
disable bold fonts in gnome terminal
dconf write /org/gnome/terminal/legacy/profiles:/:<id>/allow-bold false
@tobia
tobia / test_count.rs
Created April 12, 2019 17:38
Simple harness to measure macro expansion time
// #![recursion_limit="1003"]
// macro_rules! count {
// () => (0usize);
// ($x:tt $($xs:tt)*) => (1usize + count!($($xs)*));
// }
macro_rules! count {
() => (0usize);
($one:tt) => (1usize);
($($pairs:tt $_p:tt)*) => (count!($($pairs)*) << 1usize);
[{"week":"2007-12-31", "val":18848},
{"week":"2008-01-07", "val":18567},
{"week":"2008-01-14", "val":7916},
{"week":"2008-01-21", "val":7337},
{"week":"2008-01-28", "val":-1296},
{"week":"2008-02-04", "val":7038},
{"week":"2008-02-11", "val":3522},
{"week":"2008-02-18", "val":4957},
{"week":"2008-02-25", "val":-6891},
{"week":"2008-03-03", "val":10226},
@tobia
tobia / luminv.c
Created September 7, 2017 21:43
Fast luminance inversion (aka. color invert + hue rotate 180°)
// Fast luminance inversion.
int luminv(int rgb) {
int r = rgb >> 16,
g = rgb >> 8 & 0xff,
b = rgb & 0xff;
switch (((r > g) << 1 | (g > b)) << 1 | (b > r)) {
case 4: // r > b > g
case 3: // g > b > r
return rgb + (255 - r - g) * 0x10101;
case 2: // g > r > b
@tobia
tobia / feynman.ml
Created August 11, 2017 12:36
PBS SpaceTime Feynman Diagram Challenge
(*
Compute all possible Feynman diagrams with 1 el + 1 pos input,
1 el + 1 pos output, 4 nodes, and no self-energetic transitions.
*)
open Core.Std
type particle = Electron | Positron | Photon [@@deriving compare, sexp]
let inverse = function
| Photon -> Photon
@tobia
tobia / 8kzenrecover.py
Last active November 16, 2018 00:09 — forked from lkraav/8kzenrecover.py
8kzenrecover.py (Zen Vision M data recovery script) updated to work without LRU.py
#!/usr/bin/python
# Copyright 2007 by Tobia Conforto <tobia.conforto@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License