Skip to content

Instantly share code, notes, and snippets.

View DanielShterenberg's full-sized avatar

Daniel Shterenberg DanielShterenberg

View GitHub Profile
@DanielShterenberg
DanielShterenberg / HideScores.js
Last active August 28, 2023 11:45
Hide scores in courtside1891.basketball (Paste in TamperMonkey)
// ==UserScript==
// @name Hide Basketball Scores
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hide scores from courtside1891.basketball
// @author You
// @match https://www.courtside1891.basketball/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com
// @grant none
// ==/UserScript==
@DanielShterenberg
DanielShterenberg / pre-push-with-dir.sh
Last active September 24, 2021 07:49
Creating a pre-push Git hook which will run multiple hooks.
#!/bin/bash
cd "$(dirname "$0")/pre-push.d"
for hook in *; do
bash $hook
RESULT=$?
if [ $RESULT != 0 ]; then
echo "pre-push.d/$hook returned non-zero: $RESULT, abort commit"
exit $RESULT
@DanielShterenberg
DanielShterenberg / ListInJava.java
Created September 15, 2021 18:39
Java List - not typesafe and will generate a runtime error
List list = new ArrayList();
list.add("hello");
list.add(123);
list.add(new object);
@DanielShterenberg
DanielShterenberg / pre-push.sh
Last active December 10, 2020 23:17
pre-push hook that prints in the terminal the url to the remote branch
#!/bin/sh
remote=$1
url=$2
###extract host:
host=${url#*@} # chop off the beginning until the first '@'
host=${host%%:*} # chop off everything after the first ':'
###extract org: