Skip to content

Instantly share code, notes, and snippets.

jwalton / fluent-bit.conf
Created Jan 12, 2022
Fluent-bit playground
View fluent-bit.conf
flush 5
log_level info
daemon off
parsers_file parsers.conf
Name tail
Path /test.log
read_from_head true
jwalton /
Created May 24, 2021
Convert a PDF of JPGs to JPGs, recompress them, and then back to PDF.
# Launch a fresh VM
docker run --rm -it -v `pwd`:/mount ubuntu
# Extract PDF to JPGs
cd /mount
apt-get update
apt-get install poppler-utils
pdfimages -j file.pdf fileprefix
mkdir extract
mv *.jpg extract
View main_benchmark_test.go
package main
import (
jwalton / prefixFormat.ts
Created Jun 24, 2020
Winston Formatters
View prefixFormat.ts
import * as path from 'path';
export interface PrefixFormatOptions {
basepath?: string;
* This is a debug format, used to prefix the message with tags and filenames.
* This copies values to `message`, and strips values out of the `info` so
jwalton / useWhyRender.tsx
Created Jun 18, 2020
A react hook to figure out why a component is rendering
View useWhyRender.tsx
/* tslint:disable:no-console */
import ld from 'lodash';
import React from 'react';
* Use this hook to figure out why a React component is re-rendering.
* It will log if any properties in `props` have changed. You should
* also pass any state variables into `props` as well.
View logger middleware.ts
import * as http from 'http';
import onFinished from 'on-finished';
* Create a middleware that logs all requests.
* @param log - Logger to log to.
* @param [options] - Options.
* @param [options.excludeUrls] - An array of endpoints which should not be
jwalton / index.ts
Created Mar 29, 2019
View index.ts
import * as express from 'express';
import { createRouter } from './routes';
import translations from './translations';
const WEBPACK_AVAILABLE = (() => {
try {
return true;
} catch (err) {
return false;
#!/usr/bin/env bash
# Adapted from
# This is a script for archiving old private repos into an `attic` repo. To use, fill in the `ACCOUNT`
# variable below, then add this script to your "attic" repo, then just `./ [reponame]` from
# your cloned attic repo. This will take the contents of "reponame" and copy them into a subdirectory in
# attic named "reponame", preserving history. Note that the original repo is not modified in any way
# (we clone it to /tmp/reponame and don't push anything) and this script doesn't auto-push your attic
# repo, so if it all goes horribly wrong, it's very easy to recover.

A Dashing widget which shows an image.

To use, in your dashboard.erb file:

<li data-row="1" data-col="1" data-sizex="3" data-sizey="2">
  <div data-id="picture" data-view="BigImage" data-image=""
jwalton /
Last active Apr 1, 2021
CSS3 Transitions for Dashing Dashboards

Flying Widgets adds CSS3 transitions to your dashboard, allowing you to cycle through multiple widget sets on a single TV without page reloads, using stylish CSS3 transitions. You can even still re-order your widgets and save their locations!

Note that sinatra-cyclist is a potential alternative if the machine you use to display your dashboards is lacking in graphics horsepower.

To use, put this file in assets/javascripts/ Then find this line in

    $('.gridster ul:first').gridster