Skip to content

Instantly share code, notes, and snippets.

@tellnes
tellnes / bar.component-browser.js
Created January 10, 2018 20:51
marko TypeError bug - reproducable test case
exports.onCreate = function() {
this.state = { bar: 'static' }
setTimeout(() => {
this.state.bar = 'async'
}, 10)
}
@tellnes
tellnes / http-stream-test.js
Last active December 18, 2015 19:09
http request .write callback is never called if encoding is specified.
var http = require('http')
, assert = require('assert')
var port = 1337
var callbackCalled = false
var server = http.createServer(function (req, res) {
req.pipe(res)
server.close()
@tellnes
tellnes / blames.sh
Created November 19, 2012 11:36
Find all current lines of code in HEAD for an author
#!/bin/bash
#
# Copyright (c) Christian Tellnes <christian@tellnes.no>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@tellnes
tellnes / generate.sh
Created November 18, 2012 21:17
Generate html files
#!/bin/bash
#
# Copyright (c) Christian Tellnes <christian@tellnes.no>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@tellnes
tellnes / index.js
Created June 14, 2012 13:15
SVG Rasterizer service for Node.js
var connect = require('connect')
, exec = require('child_process').exec
, fs = require('fs')
, path = require('path')
, seaport = require('seaport')
// Detect tmp dir
var TMP_DIR = (function() {
var dirs = [process.env.TMP, '/tmp', process.cwd()]