Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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" '^\././[^/]*/\([^/]*\)/.*$'; }
// ==UserScript==
// @name immobilienscout++
// @namespace kch42
// @include http://www.immobilienscout24.de/Suche/*
// @version 1
// @grant none
// ==/UserScript==
/*
* Immobilienscout24 Suche verbessern.
@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");
@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 / hide-wikipedia-donation-nagscreen.user.js
Last active June 9, 2025 06:21
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() {