Skip to content

Instantly share code, notes, and snippets.

@silvasur
silvasur / tetris.py
Last active January 22, 2024 21:49
Tetris implementation in Python
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
# Very simple tetris implementation
#
# Control keys:
# Down - Drop stone faster
# Left/Right - Move stone
# Up - Rotate Stone clockwise
# Escape - Quit game
@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 = `
// ==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 / gmail2opera.py
Created February 25, 2011 19:27
Convert GMails CSV contacts to Operas propertiary format.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# gmail2opera.py
# Copyright (c) 2010 Kevin Chabowski
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@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.
*/
@silvasur
silvasur / backup-bitcoins.sh
Created April 10, 2011 11:54
Easily create encrypted backups of your Bitcoin wallet
#!/bin/bash
# backup-bitcoins.sh - Easily create encrypted backups of your Bitcoin wallet
# You need this tools / programs to run backup-bitcoins.sh:
# * 7z (usually in the package 7zip)
# * uuidgen (usually already installed)
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#