Skip to content

Instantly share code, notes, and snippets.

View pmuellr's full-sized avatar
🌀
Software developer @ Elastic working on Kibana. Previously @ NodeSource, IBM.

Patrick Mueller pmuellr

🌀
Software developer @ Elastic working on Kibana. Previously @ NodeSource, IBM.
View GitHub Profile
@pmuellr
pmuellr / styles.less
Last active July 8, 2021 18:42
atom personal style sheet in ~/.atom/styles.less
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
@pmuellr
pmuellr / atom-styles.less
Created April 28, 2017 02:52
some personal style settings for Atom that do some fun stuff
/* your personal stylesheet */
atom-text-editor {
/* comments are white on green */
.syntax--definition.syntax--comment,
.syntax--comment.syntax--line,
.syntax--comment.syntax--block {
background-color: green;
color: white;
}
@pmuellr
pmuellr / nsolid-profile-at-startup.js
Created February 13, 2017 16:39
run an N|Solid profile on your startup code
'use strict'
// Use this module as in the following command, to profile the startup code:
// nsolid --require ./profile-at-startup nsolid-storage
const path = require('path')
const program = path.basename(__filename).replace(/\.js$/, '')
let nsolid
@pmuellr
pmuellr / nsolid-cpu-profile-graphs.md
Last active February 7, 2017 04:10
N|Solid CPU profile visualizations

N|Solid CPU profile visualizations

Just noticed the following blog post from Brendan Gregg:

Flame Graphs vs Tree Maps vs Sunburst

Neat! Since it turns out the NodeSource N|Solid CPU profile displays those three visualizations.

You can find out more about generating CPU profiles for your Node.js apps using N|Solid by reading the documentation. But also read Brendan's blog above for some rationale on the different views.

@pmuellr
pmuellr / test-same-inner-function-listeners.js
Created February 2, 2017 20:36
test if the function passed to ee.on() and ee.removeListener() can validly be "inner functions"
'use strict'
// Not sure how valid this test is, but the attempt is to try to see if
// the function passed to ee.on() and ee.removeListener() can validly be
// "inner functions". Specifically, does the ee class consider `onEmitted()`
// functions to be different based on their closure. You would hope yes, and
// I think that's what the test shows.
//
// If they weren't considered different, instead of the listener list shrinking
// from both ends, it would shrink from just one end.
@pmuellr
pmuellr / moar-promises.js
Created November 18, 2016 16:05
moar playing around with promises and callbacks
'use strict'
const fs = require('fs')
// some tests
class Tests {
// a test
test_1 (testName, done) {
const p1 = getPromiseResolves(1)
@pmuellr
pmuellr / generators-as-streams.js
Last active August 26, 2016 02:59
pull-stream examples, but using generators
'use strict'
// some examples from https://pull-stream.github.io/ , but using generators
// function that generates random numbers forever; a source
function * random () {
while (true) {
yield Math.random()
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env bash
DB=cq_tags_2_string_fields
INFLUX="influx -database $DB -execute"
echo "dropping / creating the DB:"
echo ""
$INFLUX "DROP DATABASE IF EXISTS $DB"
$INFLUX "CREATE DATABASE $DB"
@pmuellr
pmuellr / Dillinger.svg
Created August 4, 2016 13:39
Dillinger.svg file from ns-package-graph
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.