Skip to content

Instantly share code, notes, and snippets.


Eric O'Connell drd

  • Portland, OR
View GitHub Profile
drd / BETA
Last active May 27, 2019
Hilights 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

drd /
Last active Apr 15, 2019
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:

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


  1. Choose a location for the applescript and ensure that it's executable `chmo
drd / transform.js
Created Mar 4, 2016
transform jsx with babel
View transform.js
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 / view.txt
Created Nov 5, 2012
ascii view diagrams ftw
View view.txt
| Collection View controls | <- controls region
| Form to add new item | <- form region
| Item 1 | \
+-----------------------------+ |
| Item 2 | | <- itemViewContainer
+-----------------------------+ |
| ... | /
drd / gist:914476
Created Apr 11, 2011
brew install pianobar fail
View gist:914476
$ brew install -v pianobar
==> Downloading
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 / plugin.js
Last active Sep 23, 2015
Fun with builder
View plugin.js
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 / compiler.js
Created Sep 16, 2015
A caching babel compiler for require extensions, with optional preprocessor
View compiler.js
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;
View Rails CMS alternatives
Rails CMS alternatives
Note: project activity was checked on 11/26/09 for most of these projects, and the "last update" field has not been kept up to date since then.
Active projects:
Last update: 11/24/09
View gist:300753
// This software is released under the DBAD (Dont be a duche) license.
// If you improve this code in any way, you must release your modifications publicly.
#include "Map.h"
#include <string>
#include <vector>
#include <iostream>
#define DEPTH 1
View shoulda + haml
#Install gems
gem 'mocha'
gem 'thoughtbot-shoulda'
gem 'thoughtbot-factory_girl'
gem 'technicalpickles-shoulda_generator'
gem 'mislav-will_paginate', :version => '~> 2.2.3', :lib => 'will_paginate', :source => ''
gem 'haml'
#install plugins