Skip to content

Instantly share code, notes, and snippets.

@j0hnsmith
j0hnsmith / README.md
Last active August 27, 2020 10:44
.env file to fish

.env to fish shell

install

  • go build -o readenv cmd/readenv/main.go
  • mv readenv /usr/local/bin/readenv

Usage

eval (readenv .env)

@j0hnsmith
j0hnsmith / queries.sql
Created July 28, 2020 14:21
innodb latin1 vs utf8mb4 storage for single byte chars
CREATE TABLE IF NOT EXISTS `latin` (
`name` VARCHAR(50)
)
ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `mb4` (
`name` VARCHAR(50)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Tue Jul 10 13:57:43 UTC 2018

Keybase proof

I hereby claim:

  • I am j0hnsmith on github.
  • I am j0hnsmith (https://keybase.io/j0hnsmith) on keybase.
  • I have a public key ASDEKuJ9N5r2DM7_FhmRYtHmeN_roQLNE0E1ZYDV0S8TVQo

To claim this, I am signing this object:

@j0hnsmith
j0hnsmith / Dockerfile
Created October 13, 2014 13:47
baseimage-docker/issues/151
FROM phusion/baseimage:0.9.13
ADD run /etc/service/foo/run
ADD log_run /etc/service/foo/log/run
CMD ["/sbin/my_init"]
@j0hnsmith
j0hnsmith / README.md
Last active August 29, 2015 13:56 — forked from mbostock/.block

Bubble charts encode data in the area of circles. Although less perceptually-accurate than bar charts, they can pack hundreds of values into a small space. Implementation based on work by Jeff Heer. Data shows the Flare class hierarchy, also courtesy Jeff Heer.

@j0hnsmith
j0hnsmith / pre_compile
Created September 11, 2013 21:04
Install node & npm in a Heroku Python project. The official Heroku Python buildpack now has (experimental) support for a pre_compile hook, this pre_compile script installs node & npm. Put it in bin/pre_compile in your project then npm packages in npm_requirements.txt will be installed automatically, conceptually similar to the way Python package…
#!/usr/bin/env bash
set -eo pipefail
NODE_VERSION=0.8.12
NODE_BASENAME=node-v${NODE_VERSION}-linux-x64
NODE_ARCHIVE="http://nodejs.org/dist/v${NODE_VERSION}/${NODE_BASENAME}.tar.gz"
curl -s -L -o tmp-nodejs.tar.gz $NODE_ARCHIVE
tar -zxvf tmp-nodejs.tar.gz > /dev/null
rm tmp-nodejs.tar.gz
@j0hnsmith
j0hnsmith / README.md
Last active December 17, 2015 09:59
Pie Chart Update, IV
@j0hnsmith
j0hnsmith / README.md
Last active December 17, 2015 09:59
Pie Chart Update, III

I'm continuting mbostocks's series of gists about pie charts.

This variation of a donut chart demonstrates how to add/remove slices or move between datasets of differing lengths with transitions. Clicking the radio buttons changes the displayed metric. Note how the new slice enters anticlockwise from the 'end' of the pie chart.

Previous: Animated transition. Next: Nice initial transition.

@j0hnsmith
j0hnsmith / s3_delete_keys.py
Created April 19, 2013 10:43
delete all files from a S3 bucket
#!/usr/bin/env python
from gevent import monkey
monkey.patch_all()
import sys
import optparse
from datetime import datetime
import gevent
from gevent.pool import Pool