Skip to content

Instantly share code, notes, and snippets.

View jcrugzz's full-sized avatar

Jarrett Cruger jcrugzz

View GitHub Profile
@DrHayt
DrHayt / cloud-config.yml
Last active January 20, 2021 12:03
CoreOS Container Linux etcd3 cluster cloud-config with SSL on peer, server, and client configs.
#cloud-config
ssh_authorized_keys:
- ssh-rsa PutYourKeysHere
coreos:
locksmith:
endpoint: "https://127.0.0.1:2379"
etcd_cafile: /etc/ssl/certs/ca.pem
etcd_certfile: /etc/ssl/client/client.pem
etcd_keyfile: /etc/ssl/client/client.key
@dominictarr
dominictarr / README.md
Last active February 15, 2016 14:30
expandable buffers pool

a pool of expandable buffers

pool noodles, thanks @maxogden

anyone who has played around with getting performant IO in node will tell you to get really great performance you need to avoid unnecessary memory allocations and memory copying.

Working on pull-file I could get about 1gb/s read on a warm cache, but if I just reused the same buffer over and over I could get 2gb/s!

reusing memory is easy to do in a benchmark, but in an a real system when you read data in order to do something with it. maybe you write it to another file or socket, or maybe you encrypt it? maybe you pass it to a multiplexer which adds framing and then writes that to a socket?

here are the most useful pull streams modules

combining pull streams

a library of simple functions that will be familiar functional programmers.

@bmeck
bmeck / runner.js
Created January 30, 2015 18:01
Example of making a complex runner capable of limited concurrency, disjoint continuation, and mixed concurrency/parallelism
// an example of using async / await style scheduling using callbacks
// we can do things without promises and get some nicer (imho) results
// promises still work here, but are not shown for advanced cases
function* task(step) {
//
// simple callback style continuation
//
yield _ => setTimeout(_,0);
#!/usr/bin/env node
var _ = require("underscore"),
async = require("async"),
exec = require("child_process").exec,
ProgressBar = require("progress"),
treeify = require("treeify");
var keep = [];

MDB is unlike most debuggers you've experienced.

It is not a source level debugger like gdb or lldb or even Node's builtin debugger

Generally used for postmortem analysis.

Postmortem is for Production and Development

We operate mostly on core files, though you can attach to running processes as well.

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@rvagg
rvagg / leveldb.js.md
Created January 10, 2014 01:48
Modular JavaScript storage for databases

Summary: Introduce a totally new approach to highly modular database storage, i.e. taking the vibrant Node.js Level ecosystem below LevelUP to the storage layer in 100% JavaScript.*

Facebook recently released their fork of LevelDB, named "RocksDB". Their fork is a true fork in the sense that it is not backward compatible. Facebook have added a number of new features to RocksDB but more importantly they are attempting to make something more flexible that can be adjusted to suit different workloads.

But this is not about Facebook or RocksDB because they are still riffing on the same tune, albeit with a faster tempo. But their attempt at flexibility hints at the possibilities of modular storage technologies.

The Node.js Level* ecosystem is vibrant and growing rapidly. Most of this growth is in user-land above the storage layer. In 2014 I would like to see more innovation at the storage layer itself. Facebook are demonstrating a very limited kind of modularity in RocksDB but we believe that Node.js is mu

@wolfeidau
wolfeidau / httpstest3.js
Last active December 24, 2015 23:49
NodeJS stdlib Post
'use strict';
var url = require('url');
var creds = require('./creds.js');
var https = require('https');
var scheme = 'https';
var hostname = 'api.tempo-db.com';
var baseUrl = scheme + '://' + hostname;
@juliangruber
juliangruber / 1.md
Last active November 21, 2021 21:13