Skip to content

Instantly share code, notes, and snippets.

@scybernaut
scybernaut / pick.zsh
Last active May 9, 2022 09:37
Simple zsh script for picking (and copying) on-screen color for GNOME on Wayland
#!/usr/bin/zsh
zmodload zsh/mathfunc
rgb=$(gdbus call --session --dest org.gnome.Shell.Screenshot --object-path /org/gnome/Shell/Screenshot --method org.gnome.Shell.Screenshot.PickColor | sed "s/[^0-9.,]//g")
r=$(( int(floor($(print $rgb | awk -F , '{print $1}') * 255 + 0.5)) ))
g=$(( int(floor($(print $rgb | awk -F , '{print $2}') * 255 + 0.5)) ))
b=$(( int(floor($(print $rgb | awk -F , '{print $3}') * 255 + 0.5)) ))
hex=$(printf "#%02x%02x%02x" $r $g $b)
@scybernaut
scybernaut / duolingo-hide.user.js
Last active November 24, 2021 14:44
ViolentMonkey script for covering up words in sentences with spoken audio in Duolingo
// ==UserScript==
// @name Duolingo: Hide sentences with audio
// @match https://www.duolingo.com/*
// @run-at document-end
// @version 2.0.10
// @author scybernaut
// @downloadURL https://gist.githubusercontent.com/scybernaut/36f54715fcb91f394022f4a39ad90ad8/raw/duolingo-hide.user.js
// @updateURL https://gist.githubusercontent.com/scybernaut/36f54715fcb91f394022f4a39ad90ad8/raw/duolingo-hide.user.js
// @description Cover up words in sentences with spoken audio.
// ==/UserScript==
@scybernaut
scybernaut / 01-launch-LINE.py
Last active July 16, 2021 06:01
A Python script to launch the LINE extension
#!/usr/bin/env python
import sys
from time import sleep
from os import path
from pathlib import Path
import keyring
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
@scybernaut
scybernaut / 00-reset-author.md
Last active June 21, 2021 12:01
Guide on resetting Git commits' email and author while keeping commit time intact

Set every commit's email and name

git filter-branch --env-filter '
    GIT_AUTHOR_EMAIL=<email>
    GIT_COMMITTER_EMAIL=<email>
    GIT_AUTHOR_NAME=<name>
    GIT_COMMITTER_NAME=<name>
' -- --all

Set every commit's email and name IF they matches another [NOT TESTED YET]