Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
tlrobinson / import-moves.sql
Created April 11, 2016 05:42
Import Moves app (https://www.moves-app.com/) data export files into PostgreSQL for analysis in Metabase (http://www.metabase.com/). Will need to change the paths to point to the downloaded and extracted CSVs.
CREATE TABLE activities (
"date" date,
"activity" varchar,
"group" varchar,
"start" timestamp,
"end" timestamp,
"duration" integer,
"distance" real,
"steps" integer,
"calories" integer
du -k -d1 node_modules | sort -n
12 node_modules/file-loader
16 node_modules/z-index
20 node_modules/react-addons-css-transition-group
20 node_modules/screenfull
24 node_modules/redux-thunk
28 node_modules/.bin
28 node_modules/angular-cookies
32 node_modules/angular-http-auth
36 node_modules/karma-jasmine
@tlrobinson
tlrobinson / gist:05d2354a71f5491d2f5a
Last active September 4, 2021 12:13
@azer unpublished packages
35 left-pad
30 relative-date
27 expand-home-dir
25 dom-event
22 read-json
21 is-node
20 play-audio
17 shuffle-array
17 concat
16 style-format
@tlrobinson
tlrobinson / clean-shrinkwrap.js
Last active March 22, 2016 04:48
Bring sanity to npm 2's shrinkwrap. Makes "npm shrinkwrap" deterministic. Similar but simpler than Uber's npm-shrinkwrap. From https://github.com/metabase/metabase/blob/master/bin/clean-shrinkwrap
#!/usr/bin/env node
var fs = require('fs');
function clean(module) {
// remove module.from
delete module.from;
// remove module.resolved unless it points to a git repo
@tlrobinson
tlrobinson / todo.css
Last active March 16, 2016 18:25 — forked from kriskowal/todo.css
/* using css syntax highlighting for giggles */
#todos {
value <- #this.value;
}
#todos:iteration {
#done.value <- value.done;
#label.value <- value.label;
#item.classList.has('active') <- value.active;
@tlrobinson
tlrobinson / giphy.sh
Created March 14, 2016 21:59
Command-line Giphy using iTerm2's imgcat (also requires curl and jq)
#!/bin/sh
tag="$(echo "$*" | sed 's/ /+/')"
random_api_url="http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=$tag"
gif_url="$(curl "$random_api_url" 2> /dev/null | jq '.data.image_url' -r)"
curl "$gif_url" 2> /dev/null | imgcat
@tlrobinson
tlrobinson / LICENSE
Last active March 2, 2016 23:51 — forked from dfm/LICENSE
XKCD-style plots in d3
Copyright (c) 2012–2013 Daniel Foreman-Mackey
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@tlrobinson
tlrobinson / audit-eslint-rules.js
Created March 1, 2016 20:19
Runs ESLint with every rule enabled, prints sorted list of number of violations of each rule
#!/usr/bin/env node
/* eslint-disable */
var fs = require("fs");
var glob = require("glob");
var linter = require("eslint").linter;
var SOURCES = glob.sync("frontend/src/**/*.js*");
var ESLINT_RULES = Object.keys(require('eslint/conf/eslint.json').rules);
@tlrobinson
tlrobinson / etc_init.d_S50fastcat
Last active February 4, 2016 06:53
One Fast Cat wheel + switch + C.H.I.P.
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=fastcat
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/home/root/fastcat.sh
@tlrobinson
tlrobinson / gist:b644b9e26057ee13e3b3
Last active June 1, 2016 05:10
every npm/node DLL-hell related error I encounter
metabase/ on master $ npm run build-hot
> [email protected] build-hot /Users/tlrobinson/Sync/Work/Metabase/metabase
> NODE_ENV=hot ./node_modules/webpack/bin/webpack.js && NODE_ENV=hot node_modules/webpack-dev-server/bin/webpack-dev-server.js --hot --inline --content-base frontend
module.js:339
throw err;
^
Error: Cannot find module 'optimist'