Skip to content

Instantly share code, notes, and snippets.

>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dynamic module does not define init function (init_mysql)
>>>
parameters:
kernel.include_core_classes: false
kernel.config:
charset: UTF-8
error_handler_level: null
web.config: ~
web.templating:
<?php
class faTask extends sfBaseTask
{
static private function getMemoryLimit()
{
return ini_get('memory_limit')*1024;
}
static private function getMemoryUsage()
{
@jeremyFreeAgent
jeremyFreeAgent / gist:1224221
Created September 17, 2011 18:49
sudo port install apache2
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_www_apache2/apache2/work/httpd-2.2.21" && /usr/bin/make -j2 -w all " returned error 2
@jeremyFreeAgent
jeremyFreeAgent / gist:3852066
Created October 8, 2012 11:39
Judy in class
<?php
class Test implements ArrayAccess, Iterator
{
protected $container;
public function __construct()
{
$this->container = new Judy(Judy::INT_TO_MIXED);
}
<?php
$judy = new Judy(Judy::INT_TO_MIXED);
$ids = array(13003, 404, 13);
foreach ($ids as $id) {
$judy[$id] = new DateTime;
}
echo count($judy);
foreach ($judy as $id => $element) {
-- Function: field(anyelement, anyarray)
-- DROP FUNCTION field(anyelement, anyarray);
CREATE OR REPLACE FUNCTION field(anyelement, anyarray)
RETURNS integer AS
$BODY$
SELECT
COALESCE((SELECT i
FROM generate_series(1, array_upper($2, 1)) gs(i)
@jeremyFreeAgent
jeremyFreeAgent / jolinotif.php
Last active September 17, 2015 15:17
jolicode/jolinotif example
<?php
<<<CONFIG
packages:
- "jolicode/jolinotif: dev-master"
CONFIG;
use Joli\JoliNotif\Notification;
use Joli\JoliNotif\NotifierFactory;
$notifier = NotifierFactory::create();

Keybase proof

I hereby claim:

  • I am jeremyfreeagent on github.
  • I am jeremyfreeagent (https://keybase.io/jeremyfreeagent) on keybase.
  • I have a public key ASDAHBR5ZWzbZR3H4MYNZuGqUSfW4Lz9R2gIxJeQoxj2dwo

To claim this, I am signing this object: