Skip to content

Instantly share code, notes, and snippets.

@ddombrow
ddombrow / influxdb.sh
Created September 20, 2020 23:25
influx stack in docker run commands
docker run --name influxdb -d -p 8086:8086 -v influxdb:/var/lib/influxdb --net=influxdb influxdb
docker run --name chronograf -p 8888:8888 -v chronograf:/var/lib/chronograf chronograf --influxdb-url=http://influx:8086
docker run -p 9092:9092 --name=kapacitor -h kapacitor --net=influxdb -e KAPACITOR_INFLUXDB_0_URLS_0=http://influxdb:8086 kapacitor
@ddombrow
ddombrow / new-relic-extension.js
Last active September 13, 2018 09:17
New Relic GraphQL extension.
const { GraphQLExtension } = require("graphql-extensions");
const newrelic = require("newrelic");
function traceSummary(trace) {
if (!trace) {
return "No trace data.";
}
try {
const { duration, execution: {resolvers}} = trace;
@ddombrow
ddombrow / with-immutable.js
Created March 6, 2018 15:48
HOC and render prop component with memoization to convert immutable props to JS props.
import { Iterable } from "immutable";
import memoize from "fast-memoize";
function deImmutable(immutableProps) {
const KEY = 0;
const VALUE = 1;
return Object.entries(
immutableProps
).reduce((newProps, wrappedComponentProp) => {
newProps[wrappedComponentProp[KEY]] = Iterable.isIterable(
@ddombrow
ddombrow / gist:e8c199da54e60867986aa53f71f71258
Created January 23, 2018 12:55
make frontmatter for md files
const { promisify } = require("util");
const fs = require("fs");
const readFileAsync = promisify(fs.readFile);
const writeFileAsync = promisify(fs.writeFile);
const readDirAsync = promisify(fs.readdir);
async function doIt() {
let fileList = await readDirAsync(__dirname);

Keybase proof

I hereby claim:

  • I am ddombrow on github.
  • I am crunchnode (https://keybase.io/crunchnode) on keybase.
  • I have a public key ASCenbYiSjdDz6HBod82U7KlThP-5KT6pUyr7AZRumrh-go

To claim this, I am signing this object:

@ddombrow
ddombrow / code.exs
Created October 8, 2016 19:37 — forked from elixirplayground/code.exs
elixirplayground.com code share
defmodule DeLists do
@moduledoc """
This is the Delists module, simple code for simple list operations
"""
@doc """
Sums a list recursively.
Returns the sum of the list.
@ddombrow
ddombrow / gist:f3b831d6a56e11826c4a
Last active August 29, 2015 14:02
golang channel question
package main
import (
"fmt"
"net/http"
"sync"
)
type WebResponse struct {
url string
<!DOCTYPE html>
<html>
<head>
<script src="http:////cdnjs.cloudflare.com/ajax/libs/d3/3.4.8/d3.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div>
<svg id="threat" height="200" width="200"></svg>
<!DOCTYPE html>
<html>
<head>
<script src="http:////cdnjs.cloudflare.com/ajax/libs/d3/3.4.8/d3.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div>
<svg id="threat" height="200" width="200"></svg>
namespace tryfs
open System
open Owin
open Microsoft.AspNet.SignalR
open Microsoft.Owin.Hosting
// Use ImpromptuInterface for dynamic support in the TryFS.Send method.
// Could also use http://fssnip.net/2U or http://fssnip.net/2V
open ImpromptuInterface.FSharp