Skip to content

Instantly share code, notes, and snippets.

View beardhatcode's full-sized avatar

Robbert Gurdeep Singh beardhatcode

View GitHub Profile
@beardhatcode
beardhatcode / office-favicon-freezer.user.js
Last active April 18, 2023 11:08
Always reset the office favicon (never show the red dot)
// ==UserScript==
// @name Microsoft office stable icon
// @namespace Beeardhatcode
// @match https://outlook.office.com/mail/*
// @grant none
// @version 1.0
// @run-at document-idle
// @author -
// @description Always reset the office favicon (never show the red dot)
// ==/UserScript==
// ==UserScript==
// @name Doccle Show Download
// @namespace beardhatcode
// @match https://secure.doccle.be/doccle-euui/document/renderPdfWithPdfJS
// @grant none
// @version 1.0
// @author -
// @run-at document-idle
// @description 1/26/2023, 9:24:22 PM
// ==/UserScript==
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p pdfgrep calc curl wget
set -e
pdf="$(mktemp)"
echo "🔥"
tariefkaarturl=$(curl --silent 'https://eneco.be/nl/elektriciteit-gas/tariefkaarten' | grep -o 'https://cdn\.eneco\.be/downloads/nl/general/tk/[^"]*_NL_ENECO_GAS_FLEX.pdf')
wget --quiet -O "$pdf" "$tariefkaarturl"
echo "Got $tariefkaarturl"
energie=$(pdfgrep -o "[0-9,]*\s*>\s*Geschatte jaarprijs" ""$pdf"" | sed 's/\s.*//;s/,/./')
@beardhatcode
beardhatcode / wordle-zeuswpi-mattermost.user.js
Last active March 30, 2022 10:45
Wordle Mattermost Zeus
// ==UserScript==
// @name Wordle - zeus.gent
// @namespace Violentmonkey Scripts
// @match https://mattermost.zeus.gent/*
// @grant GM_registerMenuCommand
// @grant GM_setClipboard
// @version 1.0
// @author -
// @description 3/1/2022, 12:23:04 PM
// ==/UserScript==
mutool poster -x 2 -y 2 "$1" tmp.pdf
pdftk A=tmp.pdf cat A4 A3 A1down A2down output "$1"
@beardhatcode
beardhatcode / nix-pr-tracker.user.js
Last active May 10, 2023 07:57
Adds a link to nixpk.gs/pr-tracker in the sidebar of nixpkgs PRs
// ==UserScript==
// @name Github nixpkgs PR tracker
// @namespace beardhatcode
// @match https://github.com/*
// @version 1.0
// @author -
// @description Adds a link to nixpk.gs/pr-tracker in the sidebar
// @downloadURL https://gist.github.com/beardhatcode/aa46f81278d5f4a1d31a592eff9c6db6/raw/nix-pr-tracker.user.js
// @inject-into content
// ==/UserScript==
// ==UserScript==
// @name Epurse to ledger
// @namespace beardhatcode
// @match https://epurse.ugent.be/transaction
// @grant GM_registerMenuCommand
// @grant GM_setClipboard
// @grant GM_download
// @version 1.0
// @author -
// @run-at document-idle
@beardhatcode
beardhatcode / ReMarkable_upload_btn.user.css
Last active September 6, 2019 08:51
Add an upload button on USB Web interface of your ReMarkable, allowing you to upload without dragging.
/* ==UserStyle==
@name ReMarkable upload Button
@namespace beardhatcode.be
@version 1.0.0
@description Add an upload button on USB Web interface of your ReMarkable, allowing you to upload without dragging
@author Beardhatcode
==/UserStyle== */
@-moz-document url("http://10.11.99.1/") {
input[type="file"] {
width: 7em;
#!/usr/bin/python3
# Name: Make a JSON of folk dances based on id3 files, fix some spelling and capitalisation
# Usage: ls *.mp3 | ./extract.py
# Just pipe a list of filenames into it
# requires eyeD3 (http://eyed3.nicfit.net/)
# By Robbert Gurdeep Singh
################################################################################
import eyed3
import re
@beardhatcode
beardhatcode / keepassxc-mergetool.bash
Created March 23, 2018 14:08
A `git mergetool` for KeepassXC databases
#!/bin/bash
fbase=$1
flocal=$2
fremote=$3
fmerge=$4
echo cp $flocal $fmerge
cp $flocal $fmerge
echo keepassxc-cli merge -s "$fmerge" "$fremote"
keepassxc-cli merge -s "$fmerge" "$fremote"
exit $?