Skip to content

Instantly share code, notes, and snippets.

Stefan Sundin stefansundin

Block or report user

Report or block stefansundin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
stefansundin /
Last active Dec 3, 2019
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
# This gist contains pre-commit hooks to prevent you from commiting bad code or to the wrong branch.
# There are four variants that I have built:
# - pre-commit: stops commits to "master" and "develop" branches.
# - pre-commit-2: also includes a core.whitespace check.
# - pre-commit-3: the core.whitespace check and an EOF-newline-check.
# - pre-commit-4: only the core.whitespace check.
# - pre-commit-5: elixir formatting check.
# - pre-commit-6: prettier formatting check.
# Set desired version like this before installing:
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 Nov 15, 2019
Download all of your Team's custom Slack emojis.
# get a token from
# or if you don't have permissions to create one, you can inspect the Slack web client and you can get the one it is using
curl -q -s "$SLACK_TOKEN" | jq -Mr '.emoji | to_entries | .[] | select(.value | startswith("http")) | "\(.key) \(.value)"' | sort | while read name url; do
echo "$fn"
curl -q -s -o "$fn" "$url"
stefansundin /
Last active Oct 30, 2019
Extract attachments from emails that Gmail doesn't allow you to download. This is dumb. Please use Python >= 3.4.
#!/usr/bin/env python3
# Get your files that Gmail block. Warning message:
# "Anti-virus warning - 1 attachment contains a virus or blocked file. Downloading this attachment is disabled."
# Based on:
# Instructions:
# Go to your emails, click the arrow button in the top right, "Show original", then "Download Original".
# Move the files to the same directory as this program, then run it.
import email
stefansundin / youtube-global-shortcuts.user.js
Last active Oct 28, 2019
Makes the YouTube shortcuts work even if the player is not focused. Install Greasemonkey/Tampermonkey first, then click [Raw] to install.
View youtube-global-shortcuts.user.js
// ==UserScript==
// @name YouTube global shortcuts
// @namespace
// @homepage
// @downloadURL
// @version 1.1
// @author Stefan Sundin
// @description Makes the YouTube shortcuts work even if the player is not focused.
// @icon
// @match*
View Download and merge HTTP Live Streaming .ts files
Made by Kudusch (,, @Kudusch)
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <>
stefansundin /
Last active Oct 24, 2019
Create Chrome apps in Mac OS.
# wget
# chmod +x
# ./
echo "Note that the app will run with a separate data dir and thus not have your regular extensions and settings."
echo "What should the app be called?"
read name
stefansundin /
Last active Oct 15, 2019 — forked from 8bitDesigner/
Git post-checkout and post-merge hooks to simplify bundling and other tasks.

Make bundleing and npm installing easy

These git hooks runs bundle or npm install automatically whenever you:

  • git checkout a new branch with a different Gemfile or package.json.
  • git pull a change to Gemfile or package.json.

How to install

  1. cd awesome_git_repo
stefansundin / clop.c
Last active Oct 14, 2019
(Windows) clop.exe: like Mac's pbpaste.
View clop.c
// gcc -s -o clop clop.c
// Usage:
// clop | gpg -v
// clop /u = output is printed in Unicode
// clop /a = output is printed in ANSI
// otherwise, output is printed in OEM codepage
stefansundin / google-code-archive.rb
Created Aug 10, 2016
Export data from google-code-archive.
View google-code-archive.rb
#!/usr/bin/env ruby
require "httparty"
class CodeParty
include HTTParty
base_uri ""
You can’t perform that action at this time.