Skip to content

Instantly share code, notes, and snippets.

@kuceb
kuceb / git-merge-tree.pl
Created June 5, 2020 16:27
a better git merge-tree for printing merge conflicts
#!/usr/bin/perl
use strict;
use Term::ANSIColor;
$ARGV[1] = $ARGV[1] || 'HEAD';
my $mb = `git merge-base $ARGV[0] $ARGV[1]`;
# trim ()
#!/bin/bash
branchname=${1:-$(git rev-parse --abbrev-ref HEAD)}
if ! [ -x "$(command -v jq)" ]; then
echo 'Error: "jq" is not installed.' >&2
exit 1
fi
if [ ! $SECRET_GH_TOKEN ]; then
@kuceb
kuceb / github-notification-new-tab.js
Last active June 19, 2021 01:31
Tampermonkey script to open all links from github notification page in new tab.
// ==UserScript==
// @name Github notifications: Open in new tab
// @namespace io.kuc.ben
// @version 1.1
// @description Open all links from github notification page in new tab. Works for old and new notifications pages.
// @author bkucera
// @match https://github.com/notifications/*
// @match https://github.com/notifications*
// ==/UserScript==
@kuceb
kuceb / invert-favicon.js
Last active January 7, 2020 19:30
tampermonkey/greasemonkey script that inverts favicons for use in dark desktop themes. Just have it run on sites you'd like to invert favicons for.
(function () {
const getFavicon = () => {
return (
document.querySelector('link[href*=".ico"]')
|| document.querySelector('link[href*=".png"]')
)
}
const changeFavicon = async function () {
#! /bin/sh
# download gdown.pl perl script for downloading from google drive
wget -w0 https://raw.githubusercontent.com/circulosmeos/gdown.pl/master/gdown.pl
# download chrome-remote-desktop.deb for 64-bit debian linux
./gdown.pl https://drive.google.com/file/d/1GRasE1wOaP7kyHpMavLviZRiKlgcuF-c/view?usp=sharing chrome-remote-desktop.deb
sudo dpkg -i chrome-remote-desktop.deb