Skip to content

Instantly share code, notes, and snippets.

@silvasur
silvasur / hide-wikipedia-donation-nagscreen.user.js
Last active December 12, 2023 04:51
Userscript to hide Wikipedia donation nagscreen
// ==UserScript==
// @name Hide wikipedia donation nagscreen
// @description Wikimedia, I already give you money, leave me alone!
// @version 3
// @grant GM.setValue
// @grant GM.getValue
// @match https://*.wikipedia.org/*
// ==/UserScript==
(async function() {
@silvasur
silvasur / youtube-minus-autoplay-and-suggestions.js
Last active November 4, 2021 10:26
Greasemonkey script to deactivate autoplay and remove suggestions from the YouTube video page
// ==UserScript==
// @name YouTube minus autoplay and suggestions
// @description Removes suggestions in sidebar and end of video. Also disables autoplay.
// @version 1
// @grant none
// @include https://www.youtube.com/watch*
// ==/UserScript==
(function() {
var styles = `
@silvasur
silvasur / warmmiete_immowelt.user.js
Created March 30, 2015 20:43
Warmmiete in Suche immowelt
// ==UserScript==
// @name Warmmiete in Suche immowelt
// @namespace kch42
// @include http://www.immowelt.de/immobilien/immoliste.aspx*
// @version 1
// @grant none
// ==/UserScript==
function mkinfoelem(label, data) {
var info = document.createElement("div");
// ==UserScript==
// @name immobilienscout++
// @namespace kch42
// @include http://www.immobilienscout24.de/Suche/*
// @version 1
// @grant none
// ==/UserScript==
/*
* Immobilienscout24 Suche verbessern.
@silvasur
silvasur / mass-mp3-retag.sh
Created August 18, 2014 20:14
Mass retagging of mp3 files that don't have ID3 tags
#!/bin/sh
# Mass retagging of mp3 files that don't have ID3 tags.
# The MP3 files must be named like this to use this script:
# ./<first letter of artist>/<artist>/<album>/<track number> - <title>.<file extension(s)>
# ^-- The current working directory
exsomething() { echo "$1" | sed 's#'"$2"'#\1#'; }
exartist() { exsomething "$1" '^\././\([^/]*\)/.*$'; }
exalbum() { exsomething "$1" '^\././[^/]*/\([^/]*\)/.*$'; }
@silvasur
silvasur / martinaundmoritz.sh
Created July 26, 2014 21:29
Martina und Moritz Rezepte etwas besser druckbar aufbereiten
#!/bin/sh
# Extrahieren von [Martina und Moritz](http://martinaundmoritz.wdr.de/) Rezepten
# und aufbereiten in etwas besser druckbaren Stil.
# Klappt vielleicht auch mit anderen WDR-Rezepten.
extract_and_style() {
echo '<html>
<head>
<meta charset="utf-8"/>
@silvasur
silvasur / ToroWorkaround.php
Created May 3, 2014 19:57
A Workaround for issue #82 of anandkunal/ToroPHP
<?php
class ToroWorkaround {
public static function serve($handlers) {
/*
* Toro prefers the $_SERVER["PATH_INFO"] var to get the requested URL.
* If this var is present, everything seems to be correct.
* If it is not, some weird errors occur.
* For example, Toro sometimes can not route to the index route ("/"), when the app is not running from the servers document root.
* By constructing PATH_INFO manually using REQUEST_URI and SCRIPT_NAME, we can work around this problem.
@silvasur
silvasur / colorbuttondemo.go
Created November 3, 2013 12:10
A demo for the gtk.ColorButton widget
package main
import (
"fmt"
"github.com/mattn/go-gtk/gdk"
"github.com/mattn/go-gtk/gtk"
)
func main() {
gtk.Init(nil)
@silvasur
silvasur / ruthe2atom.sh
Last active December 25, 2015 18:39
Fetch the latest cartoon from ruthe.de and build an Atom-Feed. You can use this with newsreaders that accept commands as a feed source (e.g. newsbeuter)
#!/bin/sh
# Released under the WTFPL (wtfpl.org).
URL="http://www.ruthe.de"
toonid=`curl -s $URL | sed -n 's/^.*archiv\.php\?.*id=\([0-9]*\).*/\1/p' | sed 1q`
now=`date +%Y-%m-%dT%H:%M:%SZ`
echo -n "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<feed xmlns=\"http://www.w3.org/2005/Atom\">
@silvasur
silvasur / fix.php
Created October 1, 2013 22:54
Fixes the metadata files of a Ratatöskr plugin repository.
#!/usr/bin/env php
<?php
/*
This will repair the metadata of the packages in your repository.
Place it into the root directory of your reository and run it via the terminal (php fix.php).
If everything has worked, nothing will be printed.
You should delete this script after fixing the metadata.
*/