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-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 / 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 / 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_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 / 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('=');
@tobbez
tobbez / music-renamer.py
Last active August 29, 2015 14:17
Rename music files in a directory according to tags
#!/usr/bin/env python2
# coding: utf-8
#
# Copyright (c) 2015, tobbez
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
#!/usr/bin/env python
# coding: utf-8
#
# Copyright (c) 2015, Torbjörn Lönnemark <tobbez@ryara.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES