Skip to content

Instantly share code, notes, and snippets.

ubuntu@ip-172-31-29-177:~/foo/node-libnmap$ npm test
> node-libnmap@0.0.8 test /home/ubuntu/foo/node-libnmap
> make test
nmap
discovery method
1) validate report
module.js:356
Module._extensions[extension](this, filename);
^
Error: Symbol inchi_module not found.
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at /Users/smikes/github/inchi/lib/inchi.js:6:20
at Object.<anonymous> (/Users/smikes/github/inchi/lib/inchi.js:29:2)
@smikes
smikes / gist:8477032
Created January 17, 2014 16:59
schematic of compressed/uncompressed data handler
function handler(err, buffer) {
if(isCompressed(buffer)) {
decompress(buffer, handleUncompressedBuffer);
} else {
handleUncompressedBuffer(buffer);
}
}
function handleUncompressedBuffer(buffer) {
@smikes
smikes / output
Last active January 3, 2016 11:49
Snippet to detect node vs. browser, does not use typeof, does not use 'in'
$ node tb-harness.js
running under node
$ node test-browser.js
running under node
Chrome console reports
running in a browser test-browser.js:13
@smikes
smikes / new module
Created December 26, 2013 12:27
cached request
var rssResults;
function fetchRSSResults() {
/* queue up a re-get in 15 minutes */
setTimeout(fetchRSSResults, 15*60*1000);
http.get(url...);
// parse the rss
function isBasicType(type, value) {
return type(value).valueOf() === value;
}
test('isBasicType works', function () {
assert.ok(isBasicType(Boolean, true));
assert.ok(isBasicType(Boolean, false));
assert.ok(isBasicType(Number, 1));
@smikes
smikes / gist:7387488
Created November 9, 2013 17:04
Draw an atom with label and gradient fill
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
</style>
</head>

Keybase proof

I hereby claim:

  • I am smikes on github.
  • I am smikes (https://keybase.io/smikes) on keybase.
  • I have a public key whose fingerprint is ED32 A17B 430A 0FB4 F6E9 5C90 5AF4 4C7B D3C3 F4F1

To claim this, I am signing this object:

npm info it worked if it ends with ok
npm verb cli [ '/Users/smikes/.nvm/versions/io.js/v1.7.1/bin/iojs',
npm verb cli '/Users/smikes/src/github/npm/cli.js',
npm verb cli '-ddd',
npm verb cli 'publish' ]
npm info using npm@2.9.0
npm info using node@v1.7.1
npm verb publish [ '.' ]
npm sill cache add args [ '.', null ]
npm verb cache add spec .
npm info it worked if it ends with ok
npm verb cli [ '/Users/smikes/.nvm/versions/io.js/v1.7.1/bin/iojs',
npm verb cli '/Users/smikes/.nvm/versions/io.js/v1.7.1/bin/npm',
npm verb cli '-ddd',
npm verb cli 'publish' ]
npm info using npm@2.9.1
npm info using node@v1.7.1
npm verb publish [ '.' ]
npm sill cache add args [ '.', null ]
npm verb cache add spec .