Skip to content

Instantly share code, notes, and snippets.

@tobbez
tobbez / github_white_favicon.user.js
Last active September 16, 2023 19:11
[UserScript] GitHub: White favicon
// ==UserScript==
// @name GitHub: White favicon
// @version 1.10.0
// @author tobbez
// @match https://support.github.com/*
// @match https://github.blog/*
// @match https://opensource.guide/*
// @match https://www.githubstatus.com/*
// @match https://services.github.com/*
// @match https://desktop.github.com/*
@tobbez
tobbez / twitter-redirect-mobile.user.js
Last active June 29, 2023 21:39
Redirect all twitter URLs to the mobile site
// ==UserScript==
// @name Twitter: Redirect to mobile
// @namespace http://ryara.net/
// @version 0.1
// @author tobbez
// @match https://twitter.com/*
// @grant none
// @run-at document-start
// @downloadURL https://gist.github.com/tobbez/21181ca2458219beef53f20e04c067ea/raw/twitter-redirect-mobile.user.js
// @updateURL https://gist.github.com/tobbez/21181ca2458219beef53f20e04c067ea/raw/twitter-redirect-mobile.user.js
@tobbez
tobbez / urlrewrite_svtplay.py
Created December 6, 2010 16:53
flexget urlrewriter for SVT Play
import re
import urllib2
import logging
from flexget.plugins.plugin_urlrewriting import UrlRewritingError
from flexget.plugin import *
from flexget.utils.soup import get_soup
from flexget.utils.tools import urlopener
log = logging.getLogger('svtplay')
@tobbez
tobbez / localStorage_ssl_migration_poc2.html
Last active August 22, 2017 09:34
Proof of concept for migrating localStorage from HTTP to HTTPS #2
<!doctype html>
<html>
<head>
<title>SSL localStorage migration proof of concept #2</title>
<script type="text/javascript">
window.addEventListener('message', function (ev) {
var origin = ev.origin || event.originalEvent.origin;
if (origin !== 'http://' + document.location.host && origin != 'https://' + document.location.host) {
return;
}
@tobbez
tobbez / twitter-redirect-media-orig.user.js
Last active May 7, 2017 19:26
Twitter: Redirect media to :orig (original size)
// ==UserScript==
// @name Twitter: Redirect media to :orig
// @namespace http://ryara.net/
// @version 0.21
// @author tobbez
// @match https://pbs.twimg.com/media/*
// @match https://pbs-h2.twimg.com/media/*
// @grant none
// @run-at document-start
// @downloadURL https://gist.github.com/tobbez/c23cd46ce37eade711d900ad653f05a4/raw/twitter-redirect-media-orig.user.js
@tobbez
tobbez / directory_py.patch
Created August 30, 2016 22:50
whipper/morituri patch for directory.py
diff --git a/morituri/common/directory.py b/morituri/common/directory.py
index 47aac11..7af0df3 100644
--- a/morituri/common/directory.py
+++ b/morituri/common/directory.py
@@ -22,34 +22,21 @@
import os
+from xdg import BaseDirectory
+
@tobbez
tobbez / api.php
Last active April 23, 2016 14:04
API for Mihalism Multi Host
<?php
/*
* API for WhatIMG
* Copyright (c) 2013, tobbez
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@tobbez
tobbez / gist:5c2a2ea0fcdc68ca627a
Created March 2, 2016 08:27 — forked from calkan/gist:eaad0bc4458da16a72dd
Michael Hoffman's crazy bash_history backer upper on git
1 - Create a *private* GitHub/Bitbucket or similar git repo. Here I assume the repo is:
https://github.com/calkan/bash_history.git
2 - Create .history directory and initialize it for the repo:
mkdir $HOME/.history
cd $HOME/.history
git init
touch README.md
@tobbez
tobbez / localStorage_ssl_migration_poc.html
Last active February 18, 2016 17:29
Proof of concept for migrating localStorage from HTTP to HTTPS
<!doctype html>
<html>
<head>
<title>localStorage migration to SSL proof of concept</title>
<script type="text/javascript">
function parseHash() {
if (document.location.hash === '') return new Map();
var res = new Map();
document.location.hash.substr(1).split('&').forEach(function(e) {
var kv = e.split('=');
From 42d4cc728d6891b17eb515e229e7d90a8badf16d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Torbj=C3=B6rn=20L=C3=B6nnemark?= <tobbez@ryara.net>
Date: Wed, 16 Oct 2013 20:45:05 +0200
Subject: [PATCH] Fixed Signer.sign for Python 3
Closes #29
---
itsdangerous.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)