Skip to content

Instantly share code, notes, and snippets.

@joeybaker
joeybaker / gist:2654964
Created May 10, 2012 18:38
Hide Dock Icon in plist
<key>NSUIElement</key>
<string>1</string>
@joeybaker
joeybaker / cleanmail.sh
Created May 10, 2012 18:39
Clean Mail.app Database
# 1. Quit mail
# 2. Load terminal
# 3. cd ~/Library/Mail
# 4. sqlite3 Envelope\ Index
# 5. at the 'sqlite>' prompt, enter 'vacuum subjects;' and then 'vacuum;'
# 6. Reload mail - it may well be faster loading and your search may well work again!
cd ~/Library/Mail
sqlite3 Envelope\ Index
vacuum subjects;
@joeybaker
joeybaker / killsleep.sh
Created May 10, 2012 18:40
Remove the Sleep Image
sudo rm /var/vm/sleepimage
@joeybaker
joeybaker / pulldb.sh
Created September 15, 2012 00:10
Import a DB from Heroku. Only, be fast about.
#! /bin/bash
#
# You should do a find/replace for APPNAME, LOCALDBUSER, and LOCALDBNAME
#
# via https://devcenter.heroku.com/articles/pgbackups#importing-from-a-backup, https://github.com/heroku/heroku/issues/556
# by: @joeybaker
heroku pgbackups:capture --expire --app APPNAME
curl -o latest.sql `heroku pgbackups:url --app APPNAME`
@joeybaker
joeybaker / lrupdate.sh
Created January 23, 2013 21:56
change Livereload SASS and Compass to RVM versions
#!/bin/bash
gem update sass
gem update compass
if [ -h "/Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/sass" ]
then
sudo rm /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/sass
else
sudo mv /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/sass /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/sass.orig
fi
if [ -h "/Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass" ]
@joeybaker
joeybaker / gist:5454341
Created April 24, 2013 18:25
Feinstein on CISPA
Dear Mr. Baker:
Thank you for your letter concerning the "Cyber Intelligence Sharing and Protection Act" (H.R. 3523). I appreciate your taking the time to write and welcome the opportunity to respond.
The Cyber Intelligence Sharing and Protection Act was introduced in the House of Representatives on February 13, 2013 by Representative Mike Rogers (R-MI). The bill would, among other things, establish procedures to allow the Intelligence Community to share cyber threat intelligence with the private sector.
(function(window, factory) {
if (typeof exports === "object") {
// Node. Does not work with strict CommonJS, but only CommonJS-like
// enviroments that support module.exports, like Node.
module.exports = factory();
} else if (typeof define === "function" && define.amd) {
// Allow using this built library as an AMD module in another project. That
// other project will only see this AMD call, not the internal modules in
// the closure below.
define(factory);
@joeybaker
joeybaker / randomdata.json
Created October 1, 2013 16:26
just some random json data
[
{
"letters": "e",
"numbers": "10",
"colors": "Red"
},
{
"letters": "g",
"numbers": "19",
"colors": "Orange"

Build a re-usable HTML component that allows a user to submit a bug report about the page they're viewing.

  • The client-side component should be standalone, and easily re-usable in wider app. It's okay to require a framework(s), but dependencies must be easy to manage.
  • Also build out a server that can receive these bugs, parse them, and send them to the Github API as new issues. You can use whatever server environment you'd like.
  • To enable the github API, you should probably create a new repo. Alternatively you can mock out the Github API responses.

You should build this as if you were going to put it into production: optimize for code quality over quantity, write tests as appropriate, and so on.

It's fine if you don't actually finish.

We're going to refactor a library to make it more usable. The intention is to get the code to a point where it's a reusable component.

The library to refactor is: https://github.com/01miru/fileuploaderjs

ToDo List

This is a non-comprehensive list of things to do:

  • Convert to use jQuery instead of native browser code where possible
  • Add tests
  • Convert it UMD. Don't pollute the global scope.