Skip to content

Instantly share code, notes, and snippets.

View bcomnes's full-sized avatar
👽

Bret Comnes bcomnes

👽
View GitHub Profile
@bcomnes
bcomnes / Jenkinsfile
Created December 8, 2018 00:59
Git env vars you might need in jenkins
/*
Jenkins ENV Reference:
env.GIT_COMMIT: the commit sha of the current build
env.BRANCH_NAME: the branch name OR tag name of the current build, when it exists
env.GIT_BRANCH: same as BRANCH_NAME
env.TAG_NAME: the tag name of the current build, when it exists
*/
node_modules
coverage
.nyc_output
@bcomnes
bcomnes / launch.json5
Last active March 11, 2018 18:44
How to set up vs code debugger with a run script
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
// https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_launch-configuration-support-for-npm-and-other-tools
"version": "0.2.0",
"configurations": [
{
"name": "Launch via test NPM",
"type": "node",

Epistle 3

I hope this letter finds you well. I can hear your complaint already, “Gordon Freeman, we have not heard from you in ages!” Well, if you care to hear excuses, I have plenty, the greatest of them being I’ve been in other dimensions and whatnot, unable to reach you by the usual means. This was the case until eighteen months ago, when I experienced a critical change in my circumstances, and was redeposited on these shores. In the time since, I have been able to think occasionally about how best to describe the intervening years, my years of silence. I do first apologize for the wait, and that done, hasten to finally explain (albeit briefly, quickly, and in very little detail) events following those described in my previous game (referred to herewith as Episode 2).

To

@bcomnes
bcomnes / idb-dat-storage.js
Created January 18, 2018 21:35 — forked from creationix/idb-dat-storage.js
A simple abstract-random-access implementation using indexed DB that takes advantage of hypercore's behavior or consistent boundaries/offsets.
/* eslint-env browser */
var Buffer = require('buffer').Buffer
var name = 'dat'
function withStore (type, block, callback) {
var req = indexedDB.open(name + '-db', 1)
req.onerror = () => callback(req.error)
req.onupgradeneeded = () => req.result.createObjectStore(name)
req.onsuccess = () => {
@bcomnes
bcomnes / cloudSettings
Last active January 29, 2018 17:48
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-01-05T23:15:02.658Z","extensionVersion":"v2.8.7"}
// https://medium.com/@WebReflection/dom-handleevent-a-cross-platform-standard-since-year-2000-5bf17287fd38
export default class DOMEventHandler {
constructor(ctx, node) {
if (!ctx) throw new Error("DOMEventHandler: A context is required.");
this.ctx = ctx;
if (node) this.addEventListeners(node);
}
get events() {
return (
@bcomnes
bcomnes / index.js
Last active December 18, 2017 22:19
const CC = require('class-cache')
const Class = require('some-class')
function gc (instance, key, Class) {
return instance.element
}
const c = new CC({
gc // DEFAULT GC function... most of the time you do this
// Return bool to keep or toss
@bcomnes
bcomnes / README.md
Created November 12, 2017 06:21
Slow parsing

On some files that are missing duration, parsing metadata is very slow.