Skip to content

Instantly share code, notes, and snippets.

View No9's full-sized avatar
🦀
Rusting with a slight chance of code

Anton Whalley No9

🦀
Rusting with a slight chance of code
View GitHub Profile
@No9
No9 / gist:4074070
Created November 14, 2012 19:08
Installing Erlang and CouchDb on OpenIndiana oi_151.1.7 X86
@No9
No9 / Senecabus.js
Last active December 12, 2015 10:38
var seneca = require('seneca')()
seneca.add( {cmd:'sales-tax'}, function(args){
var rate = 0.23
var total = args.net * (1+rate)
seneca.act({cmd:'tax-total'}, {total:total})
})
seneca.add( {cmd:'tax-total'}, function(args){
try{
@No9
No9 / report.json
Last active December 13, 2015 17:08
Some sample code for parsing a report file
{
"typename" : "header",
"mode":"client",
"peer":"9a6cfdf0-6bab-11e2-8648-fd224dae7ee4",
"timestamp":1359640016194,
"data":
{
"typename" : "summary",
"downloaded":909115392,
"downloadRate":2864163.073936958,
@No9
No9 / config.gypi
Created March 15, 2013 14:07
Openindiana demangled dtrace output after running node build with a manually Steps to reproduce: 1. git clone git://github.com/joyent/node.git 2. cd node 3. ./configure 4. Change host_arch and target_arch to 'x64' in config.gypi 5 make 6 npm install -g stackvis 7. Run a node process 8. sudo dtrace -n 'profile-97/execname == "node" && arg1/{ @[js…
# Do not edit. Generated by the configure script.
{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': []},
'variables': { 'clang': 0,
'gcc_version': 46,
'host_arch': 'x64',
'node_install_npm': 'true',
@No9
No9 / VCTargetsPath.reg
Last active December 15, 2015 06:59
Reg file that cured error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. VCTargetsPath.reg is all that should be required
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\4.0]
"VCTargetsPath"="$(MSBuildExtensionsPath32)\\Microsoft.Cpp\\v4.0\\"
@No9
No9 / MSBUILD.reg
Created March 22, 2013 10:39
A copy of my MSBuild.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\3.5]
"DefaultToolsVersion"="2.0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\4.0]
"DefaultToolsVersion"="2.0"
"MSBuildOverrideTasksPath"="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\"
@No9
No9 / LevelDBWindowsTestOutput
Created March 30, 2013 11:49
All seem to be filelock related.
==== Test ArenaTest.Empty
==== Test ArenaTest.Simple
==== PASSED 2 tests
==== Test BloomTest.EmptyFilter
==== Test BloomTest.Small
==== Test BloomTest.VaryingLengths
False positives: 0.23% @ length = 1 ; bytes = 9
False positives: 0.44% @ length = 2 ; bytes = 9
False positives: 0.75% @ length = 3 ; bytes = 9
False positives: 1.08% @ length = 4 ; bytes = 9
@No9
No9 / hacks.js
Created April 30, 2013 01:54 — forked from notmasteryet/hacks.js
(function() {
try {
var a = new Uint8Array(1);
return; //no need
} catch(e) { }
function subarray(start, end) {
return this.slice(start, end);
}

The browser field is provided by a module author as a hint to javascript bundlers or component tools when preparing modules for client side use.

terms

Below are common terms used in the rest of the document

server

This is a non-dom based javascript execution environment. It usually only contains the base javascript language spec libraries and objects along with modules to communicate with OS features (available through commonjs require).

client

;(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(require,module,exports){
var leveldowngap = require('leveldown-gap')
, levelup = require('levelup')
, factory = function (location) { return new leveldowngap(location) }
, db = levelup('/does/not/matter', { db: factory })
db.put('name', 'Yuri Irsenovich Kim')
db.put('dob', '16 February 1941')
db.put('spouse', 'Kim Young-sook')
db.put('occupation', 'Clown')