Skip to content

Instantly share code, notes, and snippets.

View gazorby's full-sized avatar
🏠
Working from home

Matthieu MN gazorby

🏠
Working from home
View GitHub Profile
@gazorby
gazorby / colabForever.js
Created March 7, 2021 23:22
Prevent colab from disconnecting
function connectRefresher() {
window.ConnectButtonIntervalId = setInterval(function ConnectButton(){
console.log("connected");
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click();
document.querySelector("colab-sessions-dialog").shadowRoot.querySelector("#footer > div > paper-button").click();
console.log("closed the dialog!!");
},60000);
}
function clearRefresher() {
#!/bin/bash
# Remove the panel border radius on orchis theme.
# make a nice looking panel when using dash-to-panel extension
css='
#panel {
border-radius: 0, 0px;
}'
@gazorby
gazorby / levenshtein.fish
Created October 25, 2021 22:06
Levenshtein distance in fish shell
function leven_dist
set -l lena (string length "$argv[1]")
set -l lenb (string length "$argv[2]")
if test $lena = 0
return $lenb
end
if test $lenb = 0
return $lena
@gazorby
gazorby / config.json
Created January 13, 2022 01:54
archinstall config
{
"audio": "pipewire",
"bootloader": "systemd-bootctl",
"custom-commands": [
"usermod -aG docker gazorby",
"pacman-key --init",
"pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com",
"pacman-key --lsign-key FBA220DFC880C036",
"pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'",
"echo -e '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist\n' | sudo tee -a /etc/pacman.conf",
@gazorby
gazorby / progress.py
Last active July 6, 2023 00:08
progress bar
"""Simple progress bar implementation.
Original code: https://stackoverflow.com/a/36985003/10735573
"""
from __future__ import annotations
import sys
from typing import TYPE_CHECKING