Skip to content

Instantly share code, notes, and snippets.

Arne Roomann-Kurrik kurrik

Block or report user

Report or block kurrik

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
kurrik /
Last active Apr 2, 2019
Sending nicely-formatted change emails from Google Apps Forms
* This script sends an email in response to form submissions.
* It formats metadata specified in the form and may be configured
* to send to different audiences depending on which options are
* chosen. The email is nicely formatted, suitable for ingestion
* into Slack.
kurrik / .tmux.conf
Last active Jun 29, 2019
Remote .tmux.conf (handles nesting, different colors)
View .tmux.conf
# Install:
# curl > ~/.tmux.conf
# Instructions:
# When nested, use an extra `ctrl-b` to issue commands to the nested session.
# E.g. to go to the next window `ctrl-b ctrl-b ctrl-n`
# Colors
set -g default-terminal "xterm-256color"
kurrik /
Last active Jan 8, 2019
ffmpeg recipes
# Convert `mymovie.mp4` to ``, re-encoding.
ffmpeg -i mymovie.mp4
# Change `` to `mymovie.mp4`, without re-encoding.
ffmpeg -i -vcodec copy -acodec copy mymovie.mp4
# Change `mymovie.mp4` to `mymovie-nosound.mp4`, dropping audio and re-encoding video to H.264 high quality
ffmpeg -i mymovie.mp4 -c:v libx264 -profile:v high -an mymovie-nosound.mp4
# Resize `mymovie.mp4` to `mymovie-480.mp4`, setting width to 480px and keeping aspect ratio
kurrik / .vimrc
Created May 10, 2014
Set up :Fmt command to autoformat JavaScript files in Vim
View .vimrc
" JavaScript formatting.
" Install - npm install -g jsfmt
function! Jsformat()
let regel=line(".")
%!jsfmt --format=true
call cursor(regel, 1)
autocmd BufRead,BufNewFile *.js setfiletype javascript
autocmd Filetype javascript command! Fmt call Jsformat()
kurrik / queryparams.js
Created Apr 16, 2014
EC5 querystring parsing in the most obnoxiously functional way possible
View queryparams.js
var queryparams = (window.location.href.split("?")[1] || "")
.map(function(param) {
return param.split("=")
.map(function(part) { return decodeURIComponent(part); });
.reduceRight(function(prev, curr) {
if (curr.length == 2) { prev[curr[0]] = curr[1]; }
return prev;
kurrik / paste.js
Last active Aug 29, 2015
Paste in Chrome addressbar and add "javascript:" to the front to enable resizing of textareas on the page
View paste.js'textarea'), function(el) { el.setAttribute('style', 'resize: vertical');});
kurrik / manifest.json
Created Mar 31, 2014
Including embedded Tweets in a Google Chrome extension
View manifest.json
"manifest_version": 2,
"name": "crx-widgetsjs",
"description": "Load Twitter's widgets.js in a Chrome extension",
"version": "1.0",
"permissions": [
"browser_action": {
kurrik / twitter_ssl.rb
Created Mar 21, 2013
Demonstrating that Ruby sends invalid HTTPS requests unless use_ssl is explicitly set
View twitter_ssl.rb
require 'net/https'
# Returns {"errors":[{"message":"Bad Authentication data","code":215}]}
# Issues a HTTPS request to: GET
# Prints: Explicit SSL: #<Net::HTTPBadRequest:0x10b65f188>
uri = URI.parse("")
http =, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
request =
kurrik / input-time.js
Created Oct 8, 2012
Insert a time input into Twitter
View input-time.js
document.body.appendChild(function() { var e = document.createElement("input"); e.type="time";"absolute";"0px";"0px";"1000"; return e; }())
kurrik / anim.go
Created Aug 27, 2012
My favorite code from this weekend
View anim.go
// I couldn't have come up with this sober / well rested
const (
FACING_LEFT = 1 << iota
FACING_RIGHT = 1 << iota
PLAYER_STOPPED = 1 << iota
PLAYER_WALKING = 1 << iota
PLAYER_JUMPING = 1 << iota
a := map[int]*Animation{
You can’t perform that action at this time.