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 | |
class cli { | |
public static $pb_length = 50; | |
public static $pb_start = '['; | |
public static $pb_end = ']'; | |
public static $pb_bg = ' '; | |
public static $pb_fg = '='; | |
public static $pb_head = '>'; |
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 | |
$title = "Whats up?"; | |
echo preg_replace('/[^[:alnum:]]/', '', $title); |
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
=== modified file 'drupal/includes/theme.inc' | |
--- drupal/includes/theme.inc 2011-05-26 02:58:29 +0000 | |
+++ drupal/includes/theme.inc 2011-08-22 21:07:48 +0000 | |
@@ -253,7 +253,10 @@ | |
* to add more theme hooks. | |
*/ | |
function drupal_rebuild_theme_registry() { | |
- cache_clear_all('theme_registry', 'cache', TRUE); | |
+ if (lock_acquire(__FUNCTION__)) { | |
+ cache_clear_all('theme_registry', 'cache', TRUE); |
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
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ~='cd ~' | |
alias ll='tree --dirsfirst -CFupDaLg 1' | |
# Fire ze missiles! | |
# ex. nuke @dev, or nuke @test | |
function nuke() { | |
sudo /etc/init.d/varnish restart; | |
sudo /etc/init.d/httpd restart; |
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
class Appointment(models.Model): | |
# ... # | |
def save(self, *args, **kwargs): | |
update_series = kwargs.pop('update_series', True) | |
super(Appointment, self).save(*args, **kwargs) | |
if update_series and self.rrule: | |
rrule = self.rrule.get_rrule() |
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 | |
// A little header help. | |
$branch_conf_path = getcwd() . '/../.bzr/branch/branch.conf'; | |
if (!headers_sent() && file_exists($branch_conf_path)) { | |
$branch_conf = file_get_contents($branch_conf_path); | |
foreach (explode("\n", $branch_conf) as $line) { | |
list($key, $value) = explode("=", $line, 2); | |
if (trim($key) == 'bound_location') { |
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
3.93 ms | |
1.68 ms |
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
// Constructor | |
var client = new beard.Client({ | |
followRedirects: true, | |
timeout: 60, | |
encoding: 'utf-8', | |
windowize: false | |
}); | |
// Get/set any of those options at any time with: | |
client.option('followRedirects', false); |
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
<ul> | |
<li>One | |
<li>two | |
VS. | |
<ul> | |
<li>One</li> | |
<li>Two</li> | |
</ul> |
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 | |
/** | |
* Provides methods for time and memory profiling | |
* | |
* $Id$ | |
* | |
* @package Pifanstatic | |
* @author Aaron Forsander | |
* @copyright (c) 2009 Aaron Forsander |