Skip to content

Instantly share code, notes, and snippets.

Avatar

John Donahue johnmdonahue

View GitHub Profile
@johnmdonahue
johnmdonahue / .block
Last active Mar 20, 2016 — forked from mbostock/.block
Line Chart
View .block
license: gpl-3.0
@johnmdonahue
johnmdonahue / gist:6863313
Created Oct 7, 2013
.bash_history word cloud
View gist:6863313
cat ~/.bash_history | awk '$0=$1' | sort | uniq -c | sort -r
@johnmdonahue
johnmdonahue / gist:6288729
Created Aug 20, 2013
Dump repos in current directory with uncommitted changes.
View gist:6288729
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")' ';'
View gist:5971940
  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
View gist:5817460
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
@johnmdonahue
johnmdonahue / gist:5810470
Created Jun 18, 2013
REMOVE EMOJI FONT
View gist:5810470
sudo rm System/Library/Fonts/Apple\ Color\ Emoji.ttf
@johnmdonahue
johnmdonahue / static_server.js
Last active Oct 8, 2015 — 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.
View static_server.js
/* 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) {
View iterm.itermcolors
<?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 Aug 11, 2012 — 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.
View static_server.js
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 Aug 11, 2012
EE Mocha Port Questions
View gist:3319797

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?

You can’t perform that action at this time.