Skip to content

Instantly share code, notes, and snippets.

View paulchubatyy's full-sized avatar
🤍
Evaporating

Paul (xobb) Chubatyy paulchubatyy

🤍
Evaporating
View GitHub Profile
<?php
class Model_Category extends Model_Abstract {
protected static $_path;
public static function initialize(Jelly_Meta $meta)
{
$meta->table('categories')
->name_key('title')
->sorting(array('materialized_path' => 'asc'))
->fields(array(
<?php
$category = Jelly::select('category', 2);
// виводим id бацьки
echo $category->parent->id;
// крутимо дітей на...
foreach ($category->children as $cat) {
echo $cat->title;
May be pretty much anything here, flash, image with link, google adsense, anything.....
You may set the contents of this block on administrative area.
<?php
/**
* Answer model is the class that represents single answer to the
* question. It handles all the operations with answer
*
* @package cevapbankasi
*/
class Model_Answer extends Model_Abstract {
public static function initialize(Jelly_Meta $meta)
@paulchubatyy
paulchubatyy / gist:473743
Created July 13, 2010 11:20
Sample Autoload function for WordPress plugin
<?php
/**
* Plugin autoloader. Coverts class name to path and loads it
* @param string $className
*/
function autoload($className)
{
if (class_exists($className))
return;
xobb@linode ~: ps aux | grep gitorious
gitslave 2701 0.0 20.8 180244 105304 ? S 13:06 0:00 /usr/bin/ruby /opt/gitorious/mainline/script/git-daemon -d
xobb 3917 0.0 0.1 7620 904 pts/0 S+ 14:48 0:00 grep --color=auto gitorious
@paulchubatyy
paulchubatyy / virtualhost
Created July 30, 2010 13:46
Redmine installation snippets
$ sudo aptitude install redmine redmine-mysql
# aptitude update
# aptitude install build-essential zlib1g-dev tcl-dev libexpat-dev libcurl4-openssl-dev postfix \
apg geoip-bin libgeoip1 libgeoip-dev sqlite3 libsqlite3-dev imagemagick \
libpcre3 libpcre3-dev zlib1g zlib1g-dev libyaml-dev libmysqlclient15-dev libonig-dev \
ruby-dev rubygems libopenssl-ruby phpmyadmin libdbd-mysql-ruby libmysql-ruby libmagick++-dev \
zip unzip memcached git-core git-svn git-doc git-cvs irb
sudo apt-get install tor tor-geoipdb privoxy
<?php
$re = array(
'/',
'.*?', # Non-greedy match on filler
'((?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Tues|Thur|Thurs|Sun|Mon|Tue|Wed|Thu|Fri|Sat))', # Day Of Week 1
'.*?', # Non-greedy match on filler
'((?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Sept|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?))', # Month 1
'.*?', # Non-greedy match on filler
'((?:(?:[0-2]?\\d{1})|(?:[3][0,1]{1})))(?![\\d])', # Day 1
'.*?', # Non-greedy match on filler