Skip to content

Instantly share code, notes, and snippets.

View jhqv's full-sized avatar

Janek Hellqvist jhqv

  • Sweden
View GitHub Profile
@jhqv
jhqv / remove double scrobbles.js
Created November 23, 2019 22:56
Javascript bookmarklet for deleting duplicate scrobbles in Last.fm (often caused when listening to Spotify on Sonos speakers)
javascript:var elements=Array.from(document.querySelectorAll('.chartlist-row'));elements.map(function(a){var b=a.querySelector('.chartlist-name');return b&&b.textContent.replace(/\s+/g,' ').trim()}).forEach(function(a,b,c){if(a===c[b+1]||a===c[b+2]){var d=elements[b].querySelector('[data-ajax-form-sets-state="deleted"]');d&&d.click()}});
@jhqv
jhqv / rdiff.sh
Last active October 22, 2018 02:31
Remote diff file using SSH, useful for comparing config files when migrating services between machines etc.
#!/bin/bash
# Compare a local file with a remote file with (default) the same path or a custom path
# by Janek Hellqvist, 2016-10-14
# Example 1: compare same file on two different hosts
# rdiff.sh /etc/nginx/nginx.conf
# Example 2: compare local file with other remote file
# rdiff.sh /etc/nginx/conf.d/http.conf /etc/nginx/conf.d/www.conf
bold=$(tput bold)
@jhqv
jhqv / mathem.php
Created February 18, 2016 19:46 — forked from fjallstrom/mathem.php
<?php
# hello
# this is pure crap, don't even think about using it
# it doesn't filter input vars or contain ANY error handling at all
# i wrote this while putting a kid to bed in, january 2016
# i repeat: do not use this script
# i am peder@earthpeople.se, a ceo - not a real developer
# prerequisites
# you need an account at mathem