Skip to content

Instantly share code, notes, and snippets.

@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"
(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 / 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.
@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 / 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 / killsleep.sh
Created May 10, 2012 18:40
Remove the Sleep Image
sudo rm /var/vm/sleepimage
@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 / gist:2654964
Created May 10, 2012 18:38
Hide Dock Icon in plist
<key>NSUIElement</key>
<string>1</string>
@joeybaker
joeybaker / .htaccess
Created May 10, 2012 18:38
Security for WordPress
<files wp-config.php>
order allow,deny
deny from all
</files>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]
@joeybaker
joeybaker / gist:2654956
Created May 10, 2012 18:37
CSS spinner
<!doctype html>
<title>Image-free spinner</title>
<style>
@-webkit-keyframes fadeOut {
0% { opacity:1; }
100% { opacity:.1; }}
p {
position:absolute;
overflow:hidden;
top:50%;