Skip to content

Instantly share code, notes, and snippets.

@jakeonfire
jakeonfire / install.sh
Last active May 25, 2021 23:48
install the latest docker and docker compose CLI for macOS
#!/usr/bin/env bash
bin_dir=/Applications/Docker.app/Contents/Resources/bin
download_dir=$(mktemp -d)
arch=$(uname -m)
[[ ${arch} == 'x86_64' ]] && arch='amd64'
download_url=$(curl -s https://api.github.com/repos/docker/compose-cli/releases/latest | grep "browser_download_url.*docker-darwin-${arch}" | awk '{print $2}' | jq --raw-output)
curl -fsSLo "${download_dir}/docker-compose-cli.tar.gz" "${download_url}"
tar xzf "${download_dir}/docker-compose-cli.tar.gz" -C "${download_dir}" --strip-components 1

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@jakeonfire
jakeonfire / docker-compose.yml
Last active October 9, 2019 23:18
Run a redis cluster as part of a docker compose configuration (for testing and development). The below sets up 3 masters with 1 replica each.
services:
redis-cluster:
image: redis
expose:
- '7000-7005'
environment:
- PORT=7000
- NODES=6
- REPLICAS=1
- TIMEOUT=5000
@jakeonfire
jakeonfire / form-data.js
Last active February 10, 2016 19:56
JSONAPI-inheriting FormData adapter
import Ember from 'ember';
import ApplicationAdapter from './application';
export default ApplicationAdapter.extend({
// only convert to FormData for the following http methods:
methods: ['POST', 'PATCH', 'PUT'],
ajaxOptions(url, type, options) {
let unserializedData = options && options.data;
let hash = this._super(...arguments);
#!/bin/bash
if [ $# != 2 ]; then
echo "usage: ./gpg-grep filename.gpg search"
exit 1
fi
gpg --decrypt --quiet $1 | grep $2
#!/bin/bash
tempfile=tempfile
if [ $# != 1 ]; then
echo "usage: ./gpg-edit filename.gpg"
exit 1
fi
cp $1 .$1.bak
set -e
set -o pipefail
gpg --decrypt --quiet $1 | vipe | gpg --encrypt --recipient jacob --output $tempfile --yes