Skip to content

Instantly share code, notes, and snippets.

View drd's full-sized avatar

Eric O'Connell drd

View GitHub Profile
@drd
drd / compiler.js
Created September 16, 2015 18:34
A caching babel compiler for require extensions, with optional preprocessor
var babel = require('babel');
var extend = require('underscore').extend;
var path = require("path");
var os = require("os");
var fs = require("fs-ext");
var merge = require('lodash').merge;
@drd
drd / plugin.js
Last active September 23, 2015 17:43
Fun with builder
const babel = require('babel');
const ast = require('./ast');
const extraction = require('./extraction');
const freeVariables = require('./free-variables');
module.exports = function({Plugin, types: t}) {
return new Plugin('transformation', {
visitor: {
@drd
drd / gist:914476
Created April 11, 2011 22:07
brew install pianobar fail
$ brew install -v pianobar
==> Downloading https://github.com/PromyLOPh/pianobar/tarball/2011.01.24
File already downloaded and cached to /Users/eric/Library/Caches/Homebrew
/usr/bin/tar xf /Users/eric/Library/Caches/Homebrew/pianobar-2011.01.24.24
==> make PREFIX=/usr/local/Cellar/pianobar/2011.01.24
make PREFIX=/usr/local/Cellar/pianobar/2011.01.24
/usr/bin/cc -std=c99 -O3 -w -pipe -I src/libpiano -I src/libwaitress \
-I src/libezxml -I /usr/include -I /usr/include -DENABLE_FAAD \
-I /usr/include -DENABLE_MAD -c -o src/main.o src/main.c
/usr/bin/cc -std=c99 -O3 -w -pipe -I src/libpiano -I src/libwaitress \
@drd
drd / view.txt
Created November 5, 2012 19:25
ascii view diagrams ftw
+-----------------------------+
| Collection View controls | <- controls region
+-----------------------------+
| Form to add new item | <- form region
+-----------------------------+
| Item 1 | \
+-----------------------------+ |
| Item 2 | | <- itemViewContainer
+-----------------------------+ |
| ... | /
@drd
drd / transform.js
Created March 4, 2016 19:34
transform jsx with babel
const babel = require('babel-core');
const transformJsx = require('babel-plugin-transform-react-jsx');
const transformObjectRestSpread = require('babel-plugin-transform-object-rest-spread');
export function transformJsx(source) {
return babel.transform(source, { plugins: [transformJsx] });
}
@drd
drd / a-tangled-miasma.md
Last active April 15, 2019 07:57
A tangled miasma of hacks that somehow manage to launch stetho

So I got annoyed at always having to reconnect to Stetho, and I figured there would be some better way to do this in Android Studio ... and maybe there is, but this is the best I've gotten so far. Putting this together in a gist was inspired by a question on reddit: https://www.reddit.com/r/androiddev/comments/7hz3xy/stetho_anyone_know_of_a_convenient_way_to/

How does this work?

  • Use Android Studio custom Run configuration to call a new gradle task :app:launchStetho before the app launches
  • The gradle task uses launchctl (docs) to start an out-of-band AppleScript automation open-stetho.applescript
  • The AppleScript waits a few seconds, then controls Chrome to open chrome://inspect and loops until the "Inspect" action is available, and then executes a click() against that DOM element

Setup

  1. Choose a location for the applescript and ensure that it's executable `chmo
@drd
drd / BETA notice.md
Last active May 27, 2019 15:05
Hilights Beta

Beta

You are invited to participate in the Hilights Beta. This means, at this point, you are one of three people, two of which are the developers of Hilights. Therefore, you know how to get in touch with us.

Privacy Policy

All information uploaded to the initial beta of Hilights is visible to the developers. We will know who you are, but we already do. <3