$ cat hi.js var bunyan = require(‘bunyan’); var log = bunyan.createLogger({name: ‘myapp’}); log.info(‘hi’); log.warn({lang: ‘fr’}, ‘au revoir’); $ node hi.js {“name”:”myapp”,”hostname”:”banana.local”,”pid”:40161,”level”:30,”msg”:”hi”,”time”:”2013-01-04T18:46:23.851Z”,”v”:0} {“name”:”myapp”,”hostname”:”banana.local”,”pid”:40161,”level”:40,”lang”:”fr”,”msg”:”au revoir”,”time”:”2013-01-04T18:46:23.853Z”,”v”:0} Bunyan is a simple and fast JSON logging library for node.js services The true power comes when it’s combined with the bundled bunyan binary, which pretty-prints bunyan logs: Like so: $ node …
Category Archives: Elsewhere
PHPCI – Continuous Integration for PHP Projects
PHPCI is a free and open source continuous integration tool specifically designed for PHP. Built with simplicity in mind and featuring integrations with all of your favourite testing tools, we’ve created the very best platform for testing your PHP projects. Looks interesting. Host it yourself, or make use of one of the hosted plans. PHPCI …
Continue reading “PHPCI – Continuous Integration for PHP Projects”
Cordova build hook script for displaying build version in your app
#!/usr/bin/env node // This plugin replaces text in a file with the app version from config.xml. var wwwFileToReplace = "js/build.js"; var fs = require('fs'); var path = require('path'); var rootdir = process.argv[2]; function loadConfigXMLDoc(filePath) { var fs = require('fs'); var xml2js = require('xml2js'); var json = ""; try { var fileData = fs.readFileSync(filePath, 'ascii'); var …
Continue reading “Cordova build hook script for displaying build version in your app”
Why aren’t we using SSH for everything?
ssh http://t.co/E7Ilc0B0BC pic.twitter.com/CqYBR1WYO4 — Andrey Petrov (@shazow) December 13, 2014 If we can write a chatroom on top of SSH, why don’t we use it for more things? Interesting read packed with dozens of facts about the SSH protocol and why we should use it for more things. Why aren’t we using SSH for everything? …
The $2375 Amazon AWS mistake
When I got to GitHub, I checked my application.yml, and it was online with my [Amazon S3] API keys… Crap! I reverted the last few commits, and deleted all traces from GitHub. I was able to clean it up within about 5 minutes and no one else knew about the repo. After a close call, …
Bioluminescent Forest
The projection mapping “bioluminescent forest” is made by artists Friedrich van Schoor and Tarek Mawad. The artists spent six weeks in the forest fascinated by the silence and natural occurrences in nature, especially the phenomenon “bioluminescence”. They personified the forest to accentuate the natural beauty by creating luring luminescent plants and glowing magical mushrooms that …
Playing Quake on an oscilloscope
The XY-mode of an oscilloscope is pretty straightforward. Two voltages specify the horizontal and vertical position of the ray, so by varying these as a function of time you can draw shapes. Basically you output a set of 2D points with coordinates in range [-1, 1], view it in XY-mode on the oscilloscope and Bob’s …
U.S. Midterm Elections 2014 Maps
Why are we so confident these are the most detailed maps you’ll ever see from the 2014 Senate elections? Precincts are the smallest level of geography for publicly-reported election results. There were more than 175,000 precincts in the United States in 2012, fifty times the number of counties. The maps here show precinct-level results, where …
mdp – A command-line based markdown presentation tool.
Syncing Data With Firebase Using Ionic Framework
$scope.list = function() { fbAuth = fb.getAuth(); if(fbAuth) { var sync = $firebase(fb.child(“users/” + fbAuth.uid)); var syncObject = sync.$asObject(); syncObject.$bindTo($scope, “data”); } } Once syncObject is bound to $scope.data, which is provided by AngularFire, data will be synchronized consistently in three ways (UI, $scope.data, and Firebase): Calling $scope.data.todos.push({title: result}); will update the UI and also …
Continue reading “Syncing Data With Firebase Using Ionic Framework”