Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ceejayoz on github.
  • I am ceejayoz (https://keybase.io/ceejayoz) on keybase.
  • I have a public key whose fingerprint is 9BCC 91D8 275F 3B05 C759 CEFC 9716 E2DD 96B4 2FE6

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ceejayoz on github.
  • I am ceejayoz (https://keybase.io/ceejayoz) on keybase.
  • I have a public key whose fingerprint is 5D3B DD47 4E48 A3AE 17F1 7D33 6591 59F1 E356 A2D9

To claim this, I am signing this object:

@ceejayoz
ceejayoz / gist:6bc98920c00c46e942f1
Created January 9, 2015 15:49
speak Laravel logs out-loud!
tail -f app/storage/logs/laravel.log | while read line ; do echo $line | say ; done
{"job":"Illuminate\\Events\\CallQueuedHandler@call","data":{"class":"Multibrain\\Handlers\\Events\\FacebookPageConnectedHandler","method":"handle","data":"a:1:{i:0;O:39:\"Multibrain\\Events\\FacebookPageConnected\":1:{s:12:\"facebookPage\";O:45:\"Illuminate\\Contracts\\Database\\ModelIdentifier\":2:{s:5:\"class\";s:23:\"Multibrain\\FacebookPage\";s:2:\"id\";s:1:\"2\";}}}"}}
{"job":"Multibrain\\Analytics\\JobHandler@update","data":{"months":4,"key":"analytics:registar:6ae4e30a60db6dfedbf576b806f92f59","account_type":"Multibrain\\FacebookPage","account_id":"2"}}
{"job":"Multibrain\\Analytics\\JobHandler@update","data":{"months":4,"key":"analytics:registar:6ae4e30a60db6dfedbf576b806f92f59","account_type":"Multibrain\\FacebookPage","account_id":"2"}}
{"job":"Illuminate\\Events\\CallQueuedHandler@call","data":{"class":"Multibrain\\Handlers\\Events\\FacebookPageConnectedHandler","method":"handle","data":"a:1:{i:0;O:39:\"Multibrain\\Events\\FacebookPageConnected\":1:{s:12:\"facebookPage\";O:45:\"Illuminate\\Contr
<?php
function budget_theme_registry_alter(&$theme_registry) {
$theme_hook = 'node';
$modulepath = drupal_get_path('module', 'budget');
array_unshift($theme_registry[$theme_hook]['theme paths'], $modulepath);
}
?>
@ceejayoz
ceejayoz / gist:139687
Created July 2, 2009 20:15
Removes nasty MS Word characters from HTML content.
$text = str_replace(chr(130), ',', $text); // baseline single quote
$text = str_replace(chr(132), '"', $text); // baseline double quote
$text = str_replace(chr(133), '...', $text); // ellipsis
$text = str_replace(chr(145), "'", $text); // left single quote
$text = str_replace(chr(146), "'", $text); // right single quote
$text = str_replace(chr(147), '"', $text); // left double quote
$text = str_replace(chr(148), '"', $text); // right double quote
$text = mb_convert_encoding($text, 'HTML-ENTITIES', 'UTF-8');
$items['user/%user/billing'] = array(
'title' => 'Billing',
'page callback' => 'drupal_get_form',
'page arguments' => array('easy_accounts_billing', 1),
'access callback' => TRUE,
'type' => MENU_LOCAL_TASK,
);
<?php
$html = file_get_contents('http://nothnagle.travidia.com/ROP/Ads.aspx?advid=1105344');
preg_match('@<img.+class="adimg".+src="(.*)".*>@Uims', $html, $matches);
$image = $matches[1];
<?php
function google_analytics() {
print "<script type=\"text/javascript\">\n";
print "var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");\n";
print "document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));\n";
print "</script>\n";
print "<script type=\"text/javascript\">\n";
print "var pageTracker = _gat._getTracker(\"UA-2899761-10\");\n";
print "pageTracker._initData();\n";
<?php
function classifieds_menu() {
$items = array();
$items['admin/classifieds'] = array(
'title' => 'Classifieds system',
'description' => 'Administer the classifieds system.',
'access arguments' => array('access administration pages'),
'position' => 'left',