Skip to content

Instantly share code, notes, and snippets.

View allenluce's full-sized avatar

Allen Luce allenluce

  • Seattle, WA
View GitHub Profile
gall jew pal
gall jew raj
gall jew sal
gall kex pal
gall kex raj
gall kex sal
gall key pal
gall key raj
gall key sal
gall ley pal
acid legman
cage legman
bagel diner
bagel dingo
bagel dimly
acid huzzah
cage huzzah
bagel ditch
bagel divan
bagel divas
dumb hottie
gown glyphs
pun disrobe
spam punchy
tater bingo
tater gazer
tater chain
tater champ
tater chaos
tater chant
console.log(`[${process.pid}] ${Date.now()} ${config.file}\tCALL close operation`)
oldObj.close(function (err) {
console.log(`[${process.pid}] ${Date.now()} ${config.file}\tCOMPLETE close operation`)
// ... handle err ...
}
console.log(`[${process.pid}] ${Date.now()} ${config.file}\tAFTER CALL close operation`)
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
If Target.Column = 4 Or Target.Column = 5 Or Target.Column = 6 Then
Target.Value = Target.Value * 0.22
End If
Application.EnableEvents = True
End Sub
calc.Dimension = &[2]map[string]*int32{
{
"dim1": i(31),
"dim2": i(37),
"dim3": i(41),
"dim4": i(43),
},
{
"dim5": i(47),
"dim6": i(53),
@allenluce
allenluce / gist:f71c89414e4c422102ec5ac8f9c8b966
Created June 30, 2016 19:12
Simple packet printer for scapy
from scapy.all import *
INPUTFILE = "rmp.imps"
for pkt in PcapReader(INPUTFILE):
if TCP in pkt:
length = pkt[IP].len-40
if length > 0:
ack = pkt[TCP].ack # Acknowledged sequence number seq = pkt[TCP].seq # Packet sequence number ip_src=pkt[IP].src
ip_dst=pkt[IP].dst
describe('proxy', function () {
it('context', function () {
const sandbox = {
p: new Proxy.ProviderProxy('hey')
}
const context = new vm.createContext(sandbox)
const script = new vm.Script('value = p._get()')
script.runInContext(context)
expect(sandbox.value).to.equal('hey')
})
@allenluce
allenluce / gist:7df5c26f4930ca77e481
Created January 26, 2016 22:21 — forked from mejibyte/gist:1233426
My implementation of Aho-Corasick's algorithm for string matching.
using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
@allenluce
allenluce / bench.js
Created December 9, 2015 21:39
Benchmarking hasOwnProperty vs. conditional test for property
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite;
var req = {
someProperty: "some value"
};
var property = "someProperty";
var notAProperty = "someProperty";