Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
tlrobinson / Dockerfile
Last active March 12, 2018 22:55
Known working Metabase dev environment
FROM debian:stretch
WORKDIR /root
RUN apt-get update
RUN apt-get install -y git openjdk-8-jre curl gpg build-essential apt-transport-https
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
@tlrobinson
tlrobinson / .babelrc
Last active January 17, 2018 10:02
React/Nashorn (Java's JavaScript interpreter) proof-of-concept. yarn && yarn build && yarn start
{
"presets": ["env"],
"plugins": ["transform-react-jsx"]
}
@tlrobinson
tlrobinson / git-log-recent.sh
Created January 15, 2018 07:23
Show all of my commits in a git repository for the last 7 days
git rev-list --remotes --author="$(git config user.name)" --date=iso --pretty --branches="*" --no-merges --since="7 days ago"
@tlrobinson
tlrobinson / gist:c0a4b31b0abe8c20b25600753a51489f
Created November 27, 2017 10:14
lightningd/regtest logs
lightningd(1): Creating lightningd dir /root/.lightning (because chdir gave No such file or directory)
lightningd(1): Trying to guess public addresses...
lightningd(1): Address 172.18.0.3:9735 is not routable
lightningd(1): Failed to connect 10 socket: Cannot assign requested address
lightningd(1): testing /usr/bin/lightningd
lightningd(1): testing /usr/bin/lightning_channeld
lightningd(1): testing /usr/bin/lightning_closingd
lightningd(1): testing /usr/bin/lightning_gossipd
lightningd(1): testing /usr/bin/lightning_hsmd
lightningd(1): testing /usr/bin/lightning_onchaind
@tlrobinson
tlrobinson / upgrade-frontend-dependencies.sh
Last active October 6, 2017 19:12
Script to try updating `yarn outdated` packages, build, and run tests, committing if successful.
#!/usr/bin/env bash
set -eu
log_dir=".upgrade-frontend-deps-logs"
mkdir -p "$log_dir"
if ! git diff-index --quiet HEAD --; then
echo "Make sure the working tree doesn't have uncommitted changes"
@tlrobinson
tlrobinson / base64.clj
Created September 17, 2017 08:12
clojure base64 encode and decode for Java 8
(defn- decode-base64
[input]
(new java.lang.String (.decode (java.util.Base64/getDecoder) input) "utf-8"))
(defn- encode-base64
[input]
(.encodeToString (java.util.Base64/getEncoder) (.getBytes input)))
@tlrobinson
tlrobinson / esnextbin.md
Created May 22, 2017 18:06
esnextbin sketch
@tlrobinson
tlrobinson / esnextbin.md
Created May 15, 2017 20:36
esnextbin sketch
CREATE TABLE sf_crime_incidents (
incident_number integer,
category varchar,
description varchar,
day_of_week varchar,
date date,
time time,
police_department_district varchar,
resolution varchar,
address varchar,
@tlrobinson
tlrobinson / gist:41bbe51c77b4f3f0b185a163a90ed608
Created April 14, 2017 22:32
metabase redux cleanup regexes
String literal action names in action creator:
Find: (export\s+const\s+\w+\s*=\s*create(?:Thunk)?Action)\("([^"]+)"
Replace: export const $2 = "$2";\n$1($2
Un-namespaced action constants:
Find: export\s+const\s+(\w+)\s*=\s*["']([A-Z_]+)["']
Replace: export const $1 = "metabase/NAMESPACE/$2"