Skip to content

Instantly share code, notes, and snippets.

View peppyheppy's full-sized avatar

Paul Hepworth peppyheppy

View GitHub Profile
class UserAgentConfig
def initiatize(user_agent_string)
@ua_string_to_cache = UserAgent.parse(user_agent_string)
end
def ua
@ua_string_to_cache
#!/bin/bash
# Connects to a MySQL database to dump data in batches.
# Great for dumping large datasets.
LIMIT=1000000
OFFSET=0
MAX_ROWS=1000000000
# This loops until it has read MAX_ROWS
@peppyheppy
peppyheppy / data.db
Created September 21, 2012 07:54
blah
{}
@peppyheppy
peppyheppy / environment.txt
Created September 17, 2012 06:39
a db for a environment bot
{}
@peppyheppy
peppyheppy / ackrc
Created July 27, 2012 19:45
git, bash, zsh, and vim configurations
--type-add=ruby=.haml,.rake,.rsel,.sass,.less,.liquid,.scss,.jsp,.ftl,.coffee,.php,.conf,.hamlc,.yml
--type-set=css=.css
--nocss
@peppyheppy
peppyheppy / gist:1249816
Created September 29, 2011 02:09 — forked from avalanche123/gist:981817
GitHub Emoji
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@peppyheppy
peppyheppy / update_bind_serial.sh
Created July 8, 2011 05:47
a simple script for updating bind dns serials on multiple zone files
#!/bin/bash
mkdir backup
for file in $(ls /var/named/*.db);
do
if [ -f $file ];
then
cp $file backup/
serial=`date +%Y%m%d%H`
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-2452345-5");
pageTracker._trackPageview();
</script>