Skip to content

Instantly share code, notes, and snippets.

@silvasur
silvasur / hide-wikipedia-donation-nagscreen.js
Last active Jan 11, 2020
Userscript to hide Wikipedia donation nagscreen
View hide-wikipedia-donation-nagscreen.js
// ==UserScript==
// @name Hide wikipedia donation nagscreen
// @description Wikimedia, I already give you money, leave me alone!
// @version 3
// @grant GM.setValue
// @grant GM.getValue
// @include https://*.wikipedia.org/*
// ==/UserScript==
(async function() {
@silvasur
silvasur / youtube-minus-autoplay-and-suggestions.js
Last active Nov 1, 2019
Greasemonkey script to deactivate autoplay and remove suggestions from the YouTube video page
View youtube-minus-autoplay-and-suggestions.js
// ==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 Mar 30, 2015
Warmmiete in Suche immowelt
View warmmiete_immowelt.user.js
// ==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");
View immobilienscout_plus_plus.user.js
// ==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 Aug 18, 2014
Mass retagging of mp3 files that don't have ID3 tags
View mass-mp3-retag.sh
#!/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 Jul 26, 2014
Martina und Moritz Rezepte etwas besser druckbar aufbereiten
View martinaundmoritz.sh
#!/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
A Workaround for issue #82 of anandkunal/ToroPHP
View ToroWorkaround.php
<?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 Nov 3, 2013
A demo for the gtk.ColorButton widget
View colorbuttondemo.go
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 Dec 25, 2015
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)
View ruthe2atom.sh
#!/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 Oct 1, 2013
Fixes the metadata files of a Ratatöskr plugin repository.
View fix.php
#!/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.
*/