This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>es6 proxy #jsbench #jsperf</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
// | |
// Create our type | |
// | |
function PreLoader() { | |
this._queue = []; | |
this._mime = {}; | |
this._handlers = {}; | |
this._loaded = []; | |
}; | |
PreLoader.prototype.addFileType = function addFileType(extension,mime) { |
question: | |
- https://github.com/winstonjs/winston/issues/1107 | |
- https://github.com/winstonjs/winston/issues/1119 | |
- https://github.com/winstonjs/winston/issues/1088 | |
- https://github.com/winstonjs/winston/issues/1148 | |
- https://github.com/winstonjs/winston/issues/1167 | |
- https://github.com/winstonjs/winston/issues/1192 | |
- https://github.com/winstonjs/winston/issues/1201 | |
- https://github.com/winstonjs/winston/issues/1275 | |
- https://github.com/winstonjs/winston/issues/1226 |
// This example adapted from Matt Gallagher's "Minimalist Cocoa Programming" | |
// blog article: | |
// http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html | |
var $ = require('NodObjC') | |
$.import('Cocoa') | |
var pool = $.NSAutoreleasePool('alloc')('init') | |
, app = $.NSApplication('sharedApplication') |
So, to get something like /etc/rc.local
you can use the custom SMF import facility. (See the source
for more information about how this actually works.)
/opt
is mounted out of zones/opt
by default. You can create a directory /opt/custom/smf
and populate it with SMF manifests. Any manifests you put in there will be imported by SmartOS when it boots. Below is an example SMF manifest that simply starts /opt/custom/bin/postboot
, a self-explanatory shell script that you can use like /etc/rc.local
.
Note that it would likely be better to customise and respin your own images, as putting a bunch of platform state in the zones pool undoes some of the benefits of the ramdisk platform architecture that SmartOS has.
Error handling in an asynchronous language works in a unique way and presents many challenges, some unexpected. This tutorial reviews the various error handling patterns available in node, and explains how domains can be used to improve it.
There are four main error handling patterns in node:
var a = []; | |
a[Math.pow(2, 32) - 2] = "max index"; // highest non-expando indexed property | |
console.log(a.length === Math.pow(2, 32) - 1); // true | |
try { | |
a.push("whoa", "EVEN MOAR WHOA"); | |
} catch (e) { | |
console.log(e instanceof RangeError); // true | |
} |