Skip to content

Instantly share code, notes, and snippets.

View cupofjoakim's full-sized avatar

Joakim Wimmerstedt cupofjoakim

  • Storytel
  • Stockholm, Sweden
View GitHub Profile
@cupofjoakim
cupofjoakim / pubsub.coffee
Created April 2, 2015 10:54
framerjs pubsub
exports.pubsub = (->
listeners = {}
subscribe: (name, callback) ->
listeners[name] = [] unless listeners[name]
listeners[name].push callback
publish: (name) ->
args = Array::slice.call(arguments, 1)
if listeners[name]
i = 0
@cupofjoakim
cupofjoakim / ffmpeg-convert.sh
Last active August 29, 2015 14:06
A little shell script for converting two files to avi, mp4 & wmv while keeping the resolution intact. Uses FFMPEG. Due to multiple clients with different needs for a project, we needed a smooth way of doing shizzle.
#!/bin/bash
#
# A little shell script for converting two files to
# avi, mp4 & wmv while keeping the resolution intact.
# Uses FFMPEG.
#
# Create folder inside Converts
mkdir -p Converts/$3
@cupofjoakim
cupofjoakim / recss
Created September 5, 2014 10:00
Bookmarklet for reloading css
javascript:void(function()%7Bvar%20i,a,s%3Ba%3Ddocument.getElementsByTagName(%27link%27)%3Bfor(i%3D0%3Bi%3Ca.length%3Bi%2B%2B)%7Bs%3Da%5Bi%5D%3Bif(s.rel.toLowerCase().indexOf(%27stylesheet%27)%3E%3D0%26%26s.href)%20%7Bvar%20h%3Ds.href.replace(/(%26%7C%5C%3F)forceReload%3D%5Cd%2B/,%27%27)%3Bs.href%3Dh%2B(h.indexOf(%27%3F%27)%3E%3D0%3F%27%26%27:%27%3F%27)%2B%27forceReload%3D%27%2B(new%20Date().valueOf())%7D%7D%7D)()%3B