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 defined('SYSPATH') or die('No direct script access.'); | |
class User_Model extends ORM { | |
protected $ignored_columns = array('birthday_day', 'birthday_month', 'birthday_year'); | |
public function validate(array & $array, $save = FALSE) | |
{ | |
$array = Validation::factory($array) | |
->pre_filter('trim') |
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
A unit test helper library for App Engine. | |
Note that this is currently COMPLETELY UNTESTED. Consider it demo code only. | |
This library aims to make it easier to unit-test app engine apps and libraries | |
by handling the creation and registration of service stubs and so forth for you. | |
It also provides a custom implementation of the Capability service that allows | |
you to specify what capabilities you want it to report as disabled, and it wraps | |
all stubs in a wrapper that will throw a CapabilityDisabledError if you attempt | |
to use a disabled service or method. |
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
/* | |
To avoid polluting the global namespace this uses an anonymous | |
function which is called with either the URL for an external | |
JavaScript file or a function. In either case jQuery will be loaded | |
from the Google CDN before your code is executed so it's free to | |
depend on jQuery without checking for it and can do things like | |
jQuery.getScript() to load other components (e.g. jQuery UI), | |
stylesheets, etc. | |
*/ | |
(function (target, msg) { |
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
import re | |
# http://atomboy.isa-geek.com/plone/Members/acoil/programing/double-metaphone | |
from metaphone import dm as double_metaphone | |
# get the Redis connection | |
from jellybean.core import redis | |
import models | |
# Words which should not be indexed |
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
# How to echobot with XMPP, BOSH, and Strophe | |
1. Setup ejabberd(http://www.ejabberd.im/) server and setup account [email protected] | |
NOTE: localhost should be enough. If you setup something else, make sure you add it at /etc/hosts like this | |
#/etc/hosts | |
127.0.0.1 localhost.local | |
NOTE: Also download Psi(http://psi-im.org/), and make sure you can connect to your ejabberd server. | |
2. Download strophe(http://code.stanziq.com/strophe/) and place it (eg: /Users/makoto/work/sample/strophejs-1.0) |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install | |
curl http://npmjs.org/install.sh | sh |