Skip to content

Instantly share code, notes, and snippets.

View shadowhand's full-sized avatar
🚲

Woody Gilk shadowhand

🚲
View GitHub Profile
database:
select
insert
update
delete
? create
? alter
? drop
compile
execute
<?php defined('SYSPATH') or die('No direct script access.');
return array (
'min' =>
array (
'time' => 0.004490852355957,
'memory' => 277712,
),
'max' =>
array (
<?php
$form = array(
'username' => 'shadowhand',
'password' => 'foood',
'ip' => '127.0.0.1',
);
$form = Validation::factory($form)
->rules('username', array(
<?php
public function check_profanity(Validate $array, $field, array $errors)
{
static $profanity;
if ($profanity === NULL)
{
// Compile the regex for the list of bad words
$profanity = '/\b(?:'.implode('|', Kohana::config('profanity')->as_array()).')\b/i';
<?php
$form = array(
'username' => 'shadowhand',
'password' => 'kohana',
'website' => 'http://kohanaphp.com/',
);
$form = Validate::factory($form)
<?php
$query = DB::select()->from('users')
->where_open()
->where('username', '=', 'shadowhand')
->where_open()
->or_where('last_login', 'is', NULL)
->or_where('last_login', '<', strtotime('now -1 day'))
->where_close()
->and_where('id', '>', 1)
<?php
public function __toString()
{
try
{
return $this->render();
}
catch (Exception $e)
{
# Some of this file is mine, some is take from spider's zshrc, and some from
# guckes's zshrc. Some stuff is totally random.
source /etc/profile
export PATH=/opt/local/bin:/opt/local/apache2/bin:/usr/local/bin:$PATH
export MANPATH=$MANPATH:/usr/local/man:/opt/local/man
export TERM="xterm-color"
export CLICOLOR="true"
<?php
class test {
public static function error_handler($code, $error, $file = NULL, $line = NULL)
{
throw new ErrorException($error, $code, 0, $file, $line);
}
public static function run()
:s
start %0
%0|%0
goto :s