Skip to content

Instantly share code, notes, and snippets.

View jnordberg's full-sized avatar
💾
Floppy

Johan Nordberg jnordberg

💾
Floppy
View GitHub Profile
$ node -e "process.stderr.write('bytes written: ' + process.stdout.bytesWritten)"
bytes written: 0
$ node -e "process.stderr.write('bytes written: ' + process.stdout.bytesWritten)" > test
bytes written: undefined
@jnordberg
jnordberg / dabblet.css
Created December 18, 2011 14:09
Hot button – ƒ
/* Hot button – ƒ */
button {
background: red;
border: 0.1em solid orange;
box-shadow: 0 0 1em rgba(0, 0, 0, 0.65);
border-radius: 1em;
}
@jnordberg
jnordberg / gist:1607035
Created January 13, 2012 15:42
Mongoose wasNew plugin
mongoose.plugin (schema) ->
### wasNew plugin - adds ability to check if document was
created or updated from within middlewares ###
schema.pre 'save', (next) ->
@wasNew = @isNew
next()
@jnordberg
jnordberg / gist:1713383
Created January 31, 2012 22:13
glob 3.0.1 testsuite on osx 10.7.2 using node 0.6.7
> glob@3.0.1 test /Users/jnordberg/Development/node-glob
> tap test/*.js
ok test/00-setup.js ................................... 11/11
not ok test/bash-comparison.js ........................ 18/46
Command: "node" "bash-comparison.js"
ok 1 test/a/*/+(c|g)/./d should not error
not ok 2 should match shell
---
@jnordberg
jnordberg / gist:1926447
Created February 27, 2012 19:23
npm plugin system
npm = require 'npm'
npm.load {global: true}, (error, npm) ->
npm.commands.ls [], true, (error, result) ->
for moduleName, module of result.dependencies
if moduleName[..8] == 'clitool-'
# load module as a plugin
@jnordberg
jnordberg / _.md
Created October 26, 2012 15:48
just another inlet to tributary
@jnordberg
jnordberg / config.json
Created November 8, 2012 18:55
Another Inlet
{"description":"Another Inlet","endpoint":"","display":"svg","public":true,"require":[],"tab":"edit","display_percent":0.7,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}
@jnordberg
jnordberg / mseq.coffee
Last active December 28, 2015 06:59
M-Sequence generator in CoffeeScript
###
M-Sequence Generator
https://en.wikipedia.org/wiki/Maximum_length_sequence
Johan Nordberg <code@johan-nordberg.com>
###
noop = ->
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
value
10.791426
7.120075
4.766859999999999
4.463623
6.0321419999999994
5.056761
6.229407
4.714748999999999
4.411493
@jnordberg
jnordberg / data.csv
Last active August 29, 2015 14:05 — forked from anonymous/data.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
value
10.791426
7.120075
4.766859999999999
4.463623
6.0321419999999994
5.056761
6.229407
4.714748999999999
4.411493