Skip to content

Instantly share code, notes, and snippets.


Ian Langworth ☠ statico

View GitHub Profile
statico /
Last active Aug 26, 2020
Purple Air Sensor Plugin for BitBar
#!/usr/bin/env bash
# <bitbar.title>Purple Air PM2.5 AQI</bitbar.title>
# <bitbar.dependencies>bash,jq,node</bitbar.dependencies>
# Derived from by Chongyu Yuan
COLORS=("#0ed812" "#ffde33" "#ff9933" "#cc0033" "#660099" "#7e0023" "#404040")
statico / Dockerfile
Created Mar 9, 2020
Single server prototyping with docker-compose + nginx
View Dockerfile
# Remember that additional env vars can be in a .env, which docker-compose
# uses when building the image.
FROM node:12.9.0-alpine AS base
VOLUME /usr/local/share/.cache/yarn
COPY ./ /app/
RUN npm install --silent --global yarn
RUN yarn install --pure-lockfile --non-interactive
statico / .dockerignore
Created Mar 4, 2020
TypeScript + Apollo monorepo config
View .dockerignore
statico / google-hire-to-csv.js
Last active Sep 14, 2020
Google Hire data export to useful CSV
View google-hire-to-csv.js
// This is free and unencumbered software released into the public domain.
const csv = require('fast-csv')
const dir = process.argv[2]
if (!dir) {
throw new Error('usage: export.js <export-dir>')
// Raw data from Google Hire export
statico /
Last active Nov 20, 2020
Ian's Personal Short Link Bookmark Service
statico /
Last active Apr 17, 2019
Zelda BotW icon export for Slack emoji
  1. Go to and "Save as Web Page" with Chrome
  2. In a new folder, cp ../*/*BotW_*png .
  3. Use rename to rename all the files, hopefully keeping the larger version of all files: rename -f '$_=lc $_; s/botw\W//g; s/\d+px.//i; s/_Icon//i; s/_/-/g; s/^(botw-)?/botw-/; s/[^\w.-]+//g; s/-+\.png/.png/' *
  4. Resize to 128x128px max with ImageMagick: mogrify -resize '128x128>' *.png
  5. Upload with the neutral-face-emoji-tools Chrome extension, possibly merging in to rate limit uploads
statico / streaming-csv-writer.ts
Created Mar 8, 2019
Streaming CSV Writer / TypeScript
View streaming-csv-writer.ts
import * as stringify from 'csv-stringify/lib/sync'
import * as fs from 'fs-extra'
import { Writable } from 'stream'
import * as tempy from 'tempy'
// Stringifies and writes a row at a time to disk. Call close() when finished to
// get the path to a temporary file where the CSV was written. You are
// responsible for deleting that file when finished.
export class StreamingCSVWriter {
private count: number
statico / data.ts
Created Mar 8, 2019
Get a Google Sheet using NodeJS async and TypeScript and Service Account credentials
View data.ts
import * as fs from 'fs-extra'
import { google } from 'googleapis'
import * as pathlib from 'path'
const getSheet = async (
keyFile: string,
spreadsheetId: string,
range: string
): Promise<string[][]> => {
const auth = await google.auth.getClient({
You can’t perform that action at this time.