Skip to content

Instantly share code, notes, and snippets.

@johnmdonahue
johnmdonahue / .block
Last active March 20, 2016 23:21 — forked from mbostock/.block
Line Chart
license: gpl-3.0
@johnmdonahue
johnmdonahue / gist:6863313
Created October 7, 2013 06:26
.bash_history word cloud
cat ~/.bash_history | awk '$0=$1' | sort | uniq -c | sort -r
@johnmdonahue
johnmdonahue / gist:6288729
Created August 20, 2013 23:37
Dump repos in current directory with uncommitted changes.
find . -type d -maxdepth 1 -exec sh -c '(cd {} && [ "`git status --porcelain 2>/dev/null`" != "" ] && echo "\033[0;31m> Uncommitted changes: `basename $PWD`\033[m")' ';'
@johnmdonahue
johnmdonahue / gist:5971940
Created July 11, 2013 02:07
git submodule rm
  1. Delete the relevant section from the .gitmodules file.
  2. Stage the .gitmodules changes git add .gitmodules
  3. Delete the relevant section from .git/config.
  4. Run git rm --cached path_to_submodule (no trailing slash)
  5. Run rm -rf .git/modules/submodule_name
  6. Commit
  7. Delete the now untracked submodule files
  8. rm -rf path_to_submodule
@johnmdonahue
johnmdonahue / gist:5817460
Created June 19, 2013 19:51
Port redirect hack
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
@johnmdonahue
johnmdonahue / gist:5810470
Created June 18, 2013 23:33
REMOVE EMOJI FONT ⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡
sudo rm System/Library/Fonts/Apple\ Color\ Emoji.ttf
@johnmdonahue
johnmdonahue / static_server.js
Last active October 8, 2015 19:48 — forked from respectTheCode/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
/* Adapted from: https://gist.github.com/1926868 */
var http = require('http')
, url = require('url')
, path = require('path')
, fs = require('fs')
, mime = require('mime')
, port = process.argv[2] || 8888
http.createServer(function (request, response) {
@johnmdonahue
johnmdonahue / iterm.itermcolors
Created August 16, 2012 18:48
iTerm2 Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.019607843831181526</real>
<key>Green Component</key>
<real>0.019607843831181526</real>
@johnmdonahue
johnmdonahue / static_server.js
Created August 11, 2012 04:36 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require('http')
, url = require('url')
, path = require('path')
, fs = require('fs')
, port = process.argv[2] || 8888
http.createServer(function (request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri)
@johnmdonahue
johnmdonahue / gist:3319797
Created August 11, 2012 01:30
EE Mocha Port Questions

I ran into a few things working on the mocha port, these are the ones I was smart enough to write down but if the others come to me I'll let you know.

  1. Would it make sense to give both the preview and edit iframes a div with an id or at least give the bodies id's? It would make this simpler: https://github.com/OscarGodson/EpicEditor/blob/858425d10a8e23eb3303d4847b0781f09f7dce67/test/test.getElement.js#L40

  2. Why does the editor throw an error on multiple unloads instead of just ignoring it like load? Maybe we can just check to see if it's loaded and if not don't unload it. Thoughts?