Skip to content

Instantly share code, notes, and snippets.

View paulchubatyy's full-sized avatar
🤍
Evaporating

Paul (xobb) Chubatyy paulchubatyy

🤍
Evaporating
View GitHub Profile
@paulchubatyy
paulchubatyy / apacherestart
Created November 1, 2010 11:59
install msmtp
sudo service apache2 restart
@paulchubatyy
paulchubatyy / php52.sh
Created October 28, 2010 14:54
Revert to php 5.2
#! /bin/bash
php_installed=`dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
# remove all php packge
sudo aptitude purge $php_installed
# use karmic for php pakage
# pin-params: a (archive), c (components), v (version), o (origin) and l (label).
echo -e "Package: php5\nPin: release a=karmic\nPin-Priority: 991\n" | sudo tee /etc/apt/preferences.d/php > /dev/null
<?php
//....
Kohana::modules(array(
// 'database' => MODPATH.'database', //Database
// 'kodoc' => MODPATH.'kodoc', // Kohana documentation
// 'orm' => MODPATH.'orm', // Object Relationship Mapping (not complete)
'auth' => MODPATH.'auth', // Database access
'pagination' => MODPATH.'pagination', // Paging of results
'image' => MODPATH.'image', // Image manipulation
'doctrine' => MODPATH.'doctrine', // Doctrine ORM
<?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
sudo apt-get install tor tor-geoipdb privoxy
# 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
@paulchubatyy
paulchubatyy / virtualhost
Created July 30, 2010 13:46
Redmine installation snippets
$ sudo aptitude install redmine redmine-mysql
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 / 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;
<?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)