Skip to content

Instantly share code, notes, and snippets.

View bjoerge's full-sized avatar

Bjørge Næss bjoerge

View GitHub Profile
@bjoerge
bjoerge / package.json
Last active September 13, 2017 07:29
npx test
{
"name": "gist-test",
"version": "0.0.0",
"bin": "./run.js"
}
@bjoerge
bjoerge / .gitignore
Last active March 14, 2017 12:07
gen-hotspot-styles
node_modules
[
{
"op": "replace",
"path": [
"nodes",
"0",
"nodes",
"0",
"characters",
"8",
@bjoerge
bjoerge / replayer.js
Created March 16, 2016 16:20
Emit values of an array over time
export default function replayer(array, opts = {}, emit) {
let idx = 0
let timer
return {
start: next,
stop: stop,
reset: reset
}
@bjoerge
bjoerge / syncUrl.js
Last active January 31, 2016 15:00
An require('url') replacement which keeps its properties in sync and supports a custom query parser/stringifier
import url from 'url'
export default Object.assign(configure(), configure)
function configure({qsImpl} = {}) {
return {
parse(urlToParse) {
return Object.assign(createUrlObject({qsImpl}), {
href: urlToParse
})
@bjoerge
bjoerge / README.md
Last active January 13, 2016 15:41
Minimalistic pubsub

Minimalistic pubsub

function pubsubber() {
  const subscribers = []
  return {
    subscribe,
    once,
    publish
 }
@bjoerge
bjoerge / combine.js
Last active December 25, 2015 00:19
function combine() {
var funcs = Array.prototype.slice.call(arguments, 0);
return function(obj) {
var _this = this;
return funcs.reduce(function(v, func) {
return func.call(_this, v);
}, obj)
}
}
@bjoerge
bjoerge / gist:5592444
Created May 16, 2013 15:10
Display commit time on github commit feed
$('[datetime]').each(function() { $('<p>'+new Date($(this).attr('datetime'))+'</p>').insertAfter($(this))})
May 14 13:05:52 riktig.bengler.no: Running command: ffmpeg -i '/tmp/tootsie20130514-15492-1exldxc' -threads '1' -v '1' -y -acodec 'libmp3lame' -ar '44100' -ab '128000' -qscale '1.0' -f 'mp3' '/tmp/tootsie20130514-15492-1wksk7d' 2>&1
May 14 13:05:53 riktig.bengler.no: [Command output] Stream mapping:
May 14 13:05:53 riktig.bengler.no: [Command output] Stream #0.0 -> #0.0
May 14 13:05:53 riktig.bengler.no: [Command output] Press ctrl-c to stop encoding
May 14 13:05:53 riktig.bengler.no: [Command output] Error while decoding stream #0.0
May 14 13:06:05 riktig.bengler.no: [Command output] size= 168kB time=10.74 bitrate= 128.1kbits/s
May 14 13:06:05 riktig.bengler.no: [Command output] size= 319kB time=20.40 bitrate= 128.1kbits/s
May 14 13:06:05 riktig.bengler.no: [Command output] size= 474kB time=30.30 bitrate= 128.0kbits/s
May 14 13:06:05 riktig.bengler.no: [Command output] size= 641kB time=41.04 bitrate= 128.0kbits/s
May 14 13:06:05 riktig.bengler.no: [Command output] size= 804kB time=51.44 b