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
#!/usr/bin/env bash
# https://aur.archlinux.org/packages/pulseaudio-bluetooth-a2dp-gdm-fix
sudo groupadd pulse-users
sudo chown -R root:pulse-users /usr/bin/pulseaudio
sudo usermod -a -G pulse-users $USER
@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
@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 / 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
#!/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 / 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() {
# Modified version of Google Python style guide to be compatible with black formatter
# This Pylint rcfile contains a best-effort configuration to uphold the
# best-practices and style described in the Google Python style guide:
# https://google.github.io/styleguide/pyguide.html
#
# Its canonical open-source location is:
# https://google.github.io/styleguide/pylintrc
[MASTER]
@gazorby
gazorby / cloudSettings
Created September 30, 2020 19:17
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-09-30T19:17:23.211Z","extensionVersion":"v3.4.3"}
/**
* Set headers according to current project mode
* In development, we send JWT token via Authorization header
* while they are stored in httponly cookie in production
*/
const authLink = setContext(async (_, { headers }) => {
// Use your async token function here:
const csrfToken = await getCsrfToken();
// Return the headers to the context so httpLink can read them
if (process.env.NODE_ENV === "development") {
# Arch Linux Install Script (alis) configuration file
#
# Some values are preceded by a ! character, this means that the value is ignored.
# Some keys accept a single value others accept multiple values as annotated in the comments.
# init
KEYS="fr"
LOG="true"
# Partition