Skip to content

Instantly share code, notes, and snippets.

@gelbermann
gelbermann / script.js
Last active October 22, 2020 21:20
GreaseMonkey: course-links from GR++ homepage
// ==UserScript==
// @name Make table content link to correct course
// @version 1
// @grant none
// @include https://grades.cs.technion.ac.il/*
// ==/UserScript==
let allFields = Array.from(document.getElementsByClassName("black-text")).slice(0,-1);
for(let i = 0 ; i < allFields.length / 2 ; i++) {
@gelbermann
gelbermann / extended-locate.sh
Last active January 17, 2023 10:50
extended-locate.sh
#!/bin/bash
### Requirements:
### - exa
### - ripgrep
### - column
### - updated db for `locate` command (best set up with a cron task)
function main() {
#!/bin/bash
class=org.gnome.desktop.interface
name=text-scaling-factor
gs_status=$(gsettings get "$class" "$name")
if [[ $gs_status = 1.0 ]]; then
echo "scaling up"
new_gs_status=1.25
else
@gelbermann
gelbermann / java_tostring_to_json.py
Last active September 1, 2023 07:45
Convert Java `toString()` output to JSON
import json
import sys
def parse_json_value(value):
try:
json_value = json.loads(value)
return json_value
except json.JSONDecodeError:
return value