Skip to content

Instantly share code, notes, and snippets.

View collegeman's full-sized avatar

Aaron Collegeman collegeman

View GitHub Profile
function mars() {
}
@collegeman
collegeman / fresh-install.mkd
Created April 29, 2010 19:57 — forked from kennethreitz/fresh-install.mkd
Fresh installation hit list for Mac OSX developers
@collegeman
collegeman / smoke-alarm-expiration-jquery.js
Created April 30, 2010 02:17
smoke-alarm-expiration-jquery.js
<script type="text/javascript">
jQuery(function() {
// now
var now = new Date();
// January 1 of this year
var jan = new Date(now.getFullYear(), 0, 1, 0, 0, 0, 0);
// seconds into year
var date = now.getTime()-jan.getTime();
// ten years ago
var d = new Date(now.getFullYear()-10, 0, 1, 0, 0, 0, date);
@collegeman
collegeman / dategroup.html
Created May 4, 2010 14:02
HTML for a grouped set of date inputs
<fieldset class="dategroup">
<p style="float: left; margin-right: 1em;">
<label for="starts">Starts</label>
<input type="text" id="starts" name="starts" class="text starts" value="" />
</p>
<p style="float: left;">
<label for="ends">Ends</label>
<input type="text" id="ends" name="ends" class="text ends" value="" />
</p>
</fieldset>
@collegeman
collegeman / smoke-alarm-expiration.en.js
Created May 7, 2010 19:33
smoke-alarm-expiration.en.js
(function(){var protocol=(location.protocol=='https:'?'https':'http');document.write('<div style="background-color: #069; background-image: url('+protocol+'://www.usfa.dhs.gov/_images/campaigns/smokealarms/widget.jpg); background-repeat: no-repeat; -moz-border-radius: 8px; -webkit-border-radius: 8px; box-shadow: 0px 0px 8px #666; -webkit-box-shadow: 0px 0px 8px #666; -moz-box-shadow: 0px 0px 8px #666; color: #fff; font-family: \'Trebuchet MS\', Arial, Helvetica, sans-serif; margin: 10px 0; text-align: center; width: 310px">'+'<h2 style="color: #b7d3e1; font-size: 20px; margin: 0; padding: 170px 0 0 0;">IT’S A FACT:</h2>'+'<p style="color: #fff; font-size: 14px; margin: 0 auto; padding-bottom: 95px; width: 280px;">If your smoke alarm was installed <span id="usfa-smokealarms-notifier-date-to-replace-en"><strong>more than 10 years ago</strong></span>, it needs to be <em>replaced</em>.</p>'+'</div>'+'<a href="'+protocol+'://www.usfa.dhs.gov/notices/ads.shtm" style="font-family: Tahoma, Geneva, sans-serif; font-s
<?php
// create a new artist
$srv = new Artist('Stevie Ray Vaughan');
$srv->played[] = 'Electric Guitar';
$srv->influences[] = new Artist('Jimi Hendrix');
$srv->influences[] = new Artist('Buddy Guy');
$srv->save();
// create another new artist
$layton = new Artist('Chris Layton');
@collegeman
collegeman / smoke-alarm-expiration.es.js
Created May 10, 2010 11:51
smoke-alarm-expiration.es.js
(function(){var protocol=(location.protocol=='https:'?'https':'http');document.write('<div class="notifieres" style="background-color: #069; background-image: url(http://www.usfa.dhs.gov/_images/campaigns/smokealarms/widget_es.jpg); background-repeat: no-repeat; -moz-border-radius: 8px; -webkit-border-radius: 8px; box-shadow: 0px 0px 8px #666; -webkit-box-shadow: 0px 0px 8px #666; -moz-box-shadow: 0px 0px 8px #666; color: #fff; font-family: \'Trebuchet MS\', Arial, Helvetica, sans-serif; margin: 10px 0; text-align: center; width: 310px">'+'<h2 style="color: #b7d3e1; font-size: 20px; margin: 0; padding: 170px 0 0 0;"">ES UN HECHO:</h2>'+'<p style="color: #fff; font-size: 14px; margin: 0 auto; padding-bottom: 95px; width: 280px;">Si su alarma de humo se instaló hace <span id="usfa-smokealarms-notifier-date-to-replace-es"><strong>más de 10 años</strong></span>, que necesita ser <em>reemplazado</em>.</p>'+'</div>'+'<a href="'+protocol+'://www.usfa.dhs.gov/notices/ads.shtm" style="font-family: Tahoma, Geneva, san
# remove all php packge
sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
sudo su
# use karmik for php pakage
echo -e "Package: php5\nPin: release a=karmic\nPin-Priority: 991\n" >> /etc/apt/preferences.d/php
apt-cache search php5-|grep php5-|awk '{print "Package:", $1,"\nPin: release a=karmic\nPin-Priority: 991\n"}' >> /etc/apt/preferences.d/php
apt-cache search -n libapache2-mod-php5 |awk '{print "Package:", $1,"\nPin: release a=karmic\nPin-Priority: 991\n"}' >> /etc/apt/preferences.d/php
exit
# add karmik to source list
sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee -a /etc/apt/sources.list.d/karmic.list
# out of the box
!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$
# I can see clearly now, but still no source control folders
!.(svn|git)
<?php
require('coreylib.php');
$api = new clAPI('http://api.twitter.com/1/statuses/mentions.xml');
$api->oAuth(
$consumer_key,
$consumer_secret,
$access_token,
$access_token_secret