This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:!(function() { | |
| url = window.location.href; | |
| imgs = new Set(); | |
| if (url.indexOf('svtplay.se') > -1) { | |
| request = new XMLHttpRequest(); | |
| request.onreadystatechange = function () { | |
| if(request.readyState === 4 && request.status === 200) { | |
| __svtplay = JSON.parse(/__svtplay'] = ({.*});/.exec(request.responseText)[1]); | |
| imgs.add(__svtplay.videoPage.video.poster.replace('{format}', 'extralarge')); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; | |
| ; Change "My Custom New Tab - Mozilla Firefox" so it matches yours (without the quotes) | |
| ; | |
| #NoEnv | |
| #SingleInstance force | |
| SendMode Input | |
| while 1 { | |
| WinWaitActive, Agenda View - Mozilla Firefox ahk_class MozillaWindowClass | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Antagning.se - toggle all information about multiple courses | |
| // @description This userscript toggles all the 'Mer information' (more information) links on every course at antagning.se | |
| // @namespace Leonard Högström | |
| // @version 2.1 | |
| // @downloadURL https://gist.github.com/iwconfig/9c7701c69cc61bef42b56c631567cef4/raw/antagning.se_toggle_info.user.js | |
| // @match https://www.antagning.se/*/favourites | |
| // @match https://www.antagning.se/*/search* | |
| // @match https://www.antagning.se/*/mypages/applications* | |
| // @grant none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name codeacademy.com enhancements | |
| // @namespace Leonard Högström | |
| // @match https://www.codecademy.com/courses/* | |
| // @grant none | |
| // ==/UserScript== | |
| // Change the text opacity of unchecked tasks for better readability | |
| // so you can do all of them at once instead of having to run the code with every completed task. | |
| [].filter.call(document.querySelectorAll('.fcn-checkpoint--disabled .fcn-checkpoint__body'),item => item) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Antagning.se enhancements - show/hide the individual applications | |
| // @description show/hide the individual applications (each term) | |
| // @namespace Leonard Högström | |
| // @version 1.0 | |
| // @match https://www.antagning.se/*/mypages/applications* | |
| // @match https://www.antagning.se/*/mypages/ | |
| // @match https://www.antagning.se/*/mypages | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| # Taken from: https://goshippo.com/blog/measure-real-size-any-python-object/ | |
| def get_size(obj, seen=None): | |
| """Recursively finds size of objects""" | |
| size = sys.getsizeof(obj) | |
| if seen is None: | |
| seen = set() | |
| obj_id = id(obj) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import threading, webbrowser | |
| from http.server import BaseHTTPRequestHandler, HTTPServer | |
| from urllib.parse import urlparse, parse_qs | |
| class S(BaseHTTPRequestHandler): | |
| def do_GET(self): | |
| code = parse_qs(urlparse(self.path).query)['code'][0] | |
| threading.Thread(target=httpd.shutdown, daemon=True).start() | |
| def callback_server(server_class=HTTPServer, handler_class=S, port=8080): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # Note: on synology, make sure your user is added to transmission | |
| # group so you can have read and write access to the destination | |
| # without sudo. | |
| import subprocess, sys, pwd, grp, os | |
| processed_path = '/tmp/filebot-output-dir' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # This script is supposed to be used with a remote torrent client, | |
| # such as transmission-remote-gtk. Add this script as a local command | |
| # and it will check if the file/dir has been sorted by filebot and if | |
| # so, open the sorted file path. If not, open the path to the unsorted | |
| # path (i.e. file/dir in 'Downloads' folder). It translates the path | |
| # to correspond to the local mount point (samba share).To parse the | |
| # xml file from filebot I use the untangle package because I'm lazy | |
| # and because it's so easy to use. Install it with pip. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Add copy to clipboard from IPython! | |
| To install, just copy it to your profile/startup directory, typically: | |
| ~/.ipython/profile_default/startup/ | |
| Example usage: | |
| %clip hello world | |
| # will store "hello world" |