This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Debugging output like a boss: automatically print_r the content of any arguments, | |
* and print those contents + the stack trace to the error log. | |
* @param As many params as you want, type is irrelevant | |
*/ | |
function error_logr(/* whatever you want */) { | |
$args = func_get_args(); | |
$message = !empty($args[0]) && is_string($args[0]) ? array_shift($args[0]) : null; | |
$e = new Exception($message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
array( | |
'abet', | |
'abut', | |
'ache', | |
'alit', | |
'ante', | |
'arch', | |
'aver', | |
'avow', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mars() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
OlderNewer