Skip to content

Instantly share code, notes, and snippets.

View billywhizz's full-sized avatar
🤓
always be learning

Andrew Johnston billywhizz

🤓
always be learning
View GitHub Profile
@billywhizz
billywhizz / bpf.md
Last active May 24, 2019 07:42
BPF Bits
@billywhizz
billywhizz / README.md
Last active December 4, 2018 23:58
dv8 DNS client example

Running

## clone the gist
git clone [email protected]:3f612e0bb9758e7fe80e629e3dc6b2c2.git
cd 3f612e0bb9758e7fe80e629e3dc6b2c2
## the docker command to use
DV8_DNS="docker run -it --rm --name=dv8-dns --net=host -v $(pwd):/app billywhizz/dv8:0.0.5a dv8 ./dns.js"
## query google 8.8.8.8 dns server using UDP on port 53
$DV8_DNS www.google.com
## query local dnsmasq using UDP on port 53
@billywhizz
billywhizz / readme.md
Created March 14, 2018 16:45
Kong Bootstrap
@billywhizz
billywhizz / 0_reuse_code.js
Created April 5, 2017 11:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@billywhizz
billywhizz / foo.md
Created April 5, 2017 11:48
the end of the world as we know it

this is a test. i am writing. how cool

here is a list

  • omg

here is some code

let a = b;
@billywhizz
billywhizz / README.md
Created February 22, 2017 23:45
uWebSockets Techempower Benchmark

install

npm install

run node.js server

node app
function inherits(ctor, superCtor) {
ctor.super_ = superCtor;
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
@billywhizz
billywhizz / Array.sliceAfter.js
Created June 6, 2013 22:48
get slice of sorted array greater than passed in value
Array.prototype.sliceAfter = function(expr) {
var index = 0;
var found = this.some(function(v, i, a) {
if(v > expr) {
index = i;
return true;
}
});
if(!found) return [];
return this.slice(index);
@billywhizz
billywhizz / statement-cache.diff
Created October 25, 2012 17:49
node-oracle statement cache patch
diff --git a/src/oracle_bindings.cpp b/src/oracle_bindings.cpp
old mode 100644
new mode 100755
index bbcf611..1ea38a2
--- a/src/oracle_bindings.cpp
+++ b/src/oracle_bindings.cpp
@@ -84,6 +84,7 @@ void OracleClient::EIO_Connect(uv_work_t* req) {
std::ostringstream connectionStr;
connectionStr << "//" << baton->hostname << ":" << baton->port << "/" << baton->database;
baton->connection = baton->environment->createConnection(baton->user, baton->password, connectionStr.str());
@billywhizz
billywhizz / bencCallbacks.js
Created April 12, 2012 12:40
response to bruno's streamline benchmark
"use strict";
var fs = require('fs');
var cache = {}, hit = 0, missed = 0;
var count = parseInt(process.argv[2]) || 1000000;
var fname = __dirname + "/benchCallbacks.js";
function bench(cb) {
var total = 0;
var current = 0;
function handleResult(err, data) {