Skip to content

Instantly share code, notes, and snippets.

View main.js
if (document.body.children.length == 1 && document.body.children[0].tagName == "VIDEO") {
document.body.children[0].style.width = "100%";
stefansundin / altdrag-toggle.ahk
Created Jun 8, 2017
Press Ctrl+Alt+A to toggle AltDrag. Compile with AutoHotKey:
View altdrag-toggle.ahk
; Press Ctrl+Alt+A to toggle AltDrag
; 0x111 = WM_COMMAND
; 0x8000+1 = SWM_TOGGLE
DetectHiddenWindows, on
SendMessage, 0x111, 0x8000+1, 0,, ahk_class AltDrag
stefansundin /
Last active Jun 9, 2021
Download all of your Team's custom Slack emojis.
#!/bin/bash -eo pipefail
# Log in to Slack in a web browser and open the network tools to inspect the traffic.
# Filter the requests with "/api/" and pick one to inspect. Click on the Headers tab and scroll down to see the request details.
# You need the xoxc token from the request body, and a copy of the cookies. It is the "d" cookie that is important, but you can copy all of them.
# Paste the values below.
# You need to have curl and jq installed.
stefansundin / .gitignore
Last active Mar 17, 2019
Gnuplot Heroku runtime metrics
View .gitignore
stefansundin /
Last active Aug 30, 2018
Replay production Heroku requests to your local dev environment.
#!/bin/bash -e
heroku logs -t -s heroku -d router -a $app | {
while IFS= read -r line
path=$(echo $line | grep -oE 'path="([^"]+)"' | cut -d'"' -f2)
code=$(curl -s -o /dev/null -w "%{http_code}" "$dev$path")
stefansundin /
Last active Mar 24, 2020
Install OpenSSH 7.3 in Ubuntu 16.04
# WARNING: Use this at your own risk. It will probably break your other packages and cause other havoc.
# These days you should just upgrade to Ubuntu 18.04.
$ ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016
stefansundin / manifest.json
Last active Apr 25, 2017
Speed up the Wistia player automatically.
View manifest.json
"name": "Wistia auto-speed",
"version": "1.0",
"description": "Automatically speed up Wistia embeds to 1.5x, and select the best quality.",
"content_scripts": [
"matches": [
stefansundin / manifest.json
Created Mar 3, 2017
Replace the TED player with the equivalent YouTube video.
View manifest.json
"name": "TED YouTube embed",
"version": "1.0",
"description": "Replace the TED player with the equivalent YouTube video.",
"content_scripts": [
"matches": ["*://*"],
"js": ["replace.js"],
"run_at": "document_end"
View twitch-extension.lua
--[[ extension v0.0.2 by Stefan Sundin
The only thing that this extension does is to act as a helper to seek to the
correct time when you open a url that contains a timestamp.
You must have the playlist parser installed as well!
1. Install the playlist parser:
stefansundin /
Last active Jun 11, 2021
Reusable class for Python requests library.
import requests
class RequestsApi:
def __init__(self, base_url, **kwargs):
self.base_url = base_url
self.session = requests.Session()
for arg in kwargs:
if isinstance(kwargs[arg], dict):
kwargs[arg] = self.__deep_merge(getattr(self.session, arg), kwargs[arg])