Skip to content

Instantly share code, notes, and snippets.

@stefansundin
stefansundin / background.js
Created May 2, 2016 03:18
WebRequest extension test that changes the response.
// The subsequent requests for the videofiles fails, but it was fun to test.
// http://www.oppetarkiv.se/
// https://developer.chrome.com/extensions/webRequest
chrome.webRequest.onBeforeRequest.addListener(
function(info) {
console.log(`Intercepted ${info.url}`);
return {redirectUrl: 'data:application/json,{"inSweden":true}'};
},
{
@stefansundin
stefansundin / compile-truecrypt-tails.md
Created May 15, 2016 23:01
Compile truecrypt in tails 2.3

compile truecrypt in tails 2.3

sudo apt-get install git build-essential devscripts debhelper pkg-config libgtk2.0-dev libfuse-dev nasm libappindicator-dev bash-completion
sudo apt-get install fakeroot

remove $(LIBS) from Main.make line 108 i.e. result: $(APPNAME): $(OBJS)

@stefansundin
stefansundin / Gemfile
Last active August 10, 2016 05:48
Use rack to host a static website.
source "https://rubygems.org"
gem "rack"
@stefansundin
stefansundin / manifest.json
Last active January 15, 2017 07:33
Replace YouPlay videos with YouTube on sweclockers.com
{
"name": "SweClockers YouTube embed",
"version": "1.1",
"description": "Trött på dålig videospelare?",
"content_scripts": [
{
"matches": ["*://www.sweclockers.com/*"],
"js": ["replace.js"],
"run_at": "document_end"
}
@stefansundin
stefansundin / manifest.json
Created March 3, 2017 22:01
Replace the TED player with the equivalent YouTube video.
{
"name": "TED YouTube embed",
"version": "1.0",
"description": "Replace the TED player with the equivalent YouTube video.",
"content_scripts": [
{
"matches": ["*://www.ted.com/talks/*"],
"js": ["replace.js"],
"run_at": "document_end"
}
#!/bin/bash
# https://gist.github.com/stefansundin/2d91d45580763cda29af
# Easily open a repo in a browser, just run `git open`
# Linux users need to change "open" to "xdg-open".
# Example installation instructions:
# curl -fL -o /usr/local/bin/git-open https://gist.githubusercontent.com/stefansundin/2d91d45580763cda29af/raw/git-open
# chmod +x /usr/local/bin/git-open
ORIGIN=`git config --get remote.origin.url | sed -e 's/\.git$//'`
@stefansundin
stefansundin / manifest.json
Last active April 25, 2017 20:21
Speed up the Wistia player automatically.
{
"name": "Wistia auto-speed",
"version": "1.0",
"description": "Automatically speed up Wistia embeds to 1.5x, and select the best quality.",
"content_scripts": [
{
"matches": [
"*://*.wistia.com/medias/*",
"*://fast.wistia.net/embed/iframe/*"
],
@stefansundin
stefansundin / altdrag-toggle.ahk
Created June 8, 2017 06:56
Press Ctrl+Alt+A to toggle AltDrag. Compile with AutoHotKey: https://www.autohotkey.com/
; Press Ctrl+Alt+A to toggle AltDrag
; 0x111 = WM_COMMAND
; 0x8000+1 = SWM_TOGGLE https://github.com/stefansundin/altdrag/blob/8547fc8ea13829af712586558851b9ed50ae23e8/altdrag.c#L27
DetectHiddenWindows, on
^!a::
SendMessage, 0x111, 0x8000+1, 0,, ahk_class AltDrag
return
@stefansundin
stefansundin / .gitignore
Last active November 18, 2017 04:04
TEMPer cron + gnuplot
*.dat
*.png
*.txt
pcsensor-temper
@stefansundin
stefansundin / git-nuke
Created August 13, 2015 00:17
Git nuke script to remove specified files from all branches and tags.
#!/bin/bash
set -o errexit
# BE VERY CAREFUL USING THIS SCRIPT. MAKE A BACKUP (OR TWO) FIRST WITH:
# git clone --mirror ...
# Install by putting this file in e.g. /usr/local/bin/git-nuke
# chmod +x /usr/local/bin/git-nuke
if [ $# -eq 0 ]; then