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 | |
/** | |
* Mysql wrapper, to handle some mysql_* functions in a OOP way. | |
* | |
*/ | |
class App_Db_Mysql { | |
const DEFAULT_ROW_COUNT = 10; | |
const DEFAULT_PAGE = 1; | |
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 | |
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { | |
/** | |
* | |
* @return void | |
*/ | |
protected function _initRouting() { | |
/* @var $fc Zend_Controller_Front */ | |
$fc = $this->getPluginResource( "frontcontroller" )->getFrontController(); |
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
def tip(msg); puts; puts msg; puts "-"*100; end | |
# | |
# 30 Ruby 1.9 Tips, Tricks & Features: | |
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
# | |
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
tip "Ruby 1.9 supports named captures in regular expressions!" |
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
# brew install re2c graphviz | |
# cd /tmp | |
# wget http://pecl.php.net/get/xhprof-0.9.2.tgz | |
# tar -xvzf xhprof-0.9.2.tgz | |
# cd xhprof-0.9.2/extension | |
# phpize | |
# MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch i386 -arch x86_64 -bind_at_load" | |
# export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET | |
# ./configure --with-php-config=/usr/local/zend/bin/php-config | |
# make |
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
module Feedzirra | |
module Parser | |
class FlickrEntry | |
include SAXMachine | |
include FeedEntryUtilities | |
element :guid, :as => :id | |
element :link, :as => :url |
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
# = YERB | |
# | |
# Who needs HAML when you have YAML + ERB? ;) | |
# | |
# See example.yaml below for an example. You can run this code | |
# by cloning this gist and then `ruby _yerb.rb example.yaml`. | |
# | |
# Notice that you need Ruby 1.9 so the hash order is preserved. | |
# Obviously, this is just for fun. Definitely slow as hell. | |
# |
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
<VirtualHost *:80> | |
ServerName ##APP_DOMAIN## | |
ServerAlias www.##APP_DOMAIN## | |
ServerAlias ##APPLICATION_ENV##.www.##APP_DOMAIN## | |
ServerAlias ##APPLICATION_ENV##.##APP_DOMAIN## | |
ServerAdmin admin@##APP_DOMAIN## | |
SetEnv APPLICATION_ENV ##APPLICATION_ENV## | |
SetEnv SERVER_HOSTNAME ##SERVER_HOSTNAME## | |
Header append X-Host-List "%{SERVER_HOSTNAME}e" |
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
$ brew install -vd emacs --cocoa --srgb | |
==> Downloading http://ftp.gnu.org/pub/gnu/emacs/emacs-23.3.tar.bz2 | |
File already downloaded in /Users/nebiros/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/nebiros/Library/Caches/Homebrew/emacs-23.3.tar.bz2 | |
==> Downloading patches | |
/usr/bin/curl -f#LA Homebrew 0.8 (Ruby 1.8.7-249; Mac OS X 10.7) http://repo.or.cz/w/emacs.git/commitdiff_plain/c8bba48c5889c4773c62a10f7c3d4383881f11c1 -o 001-homebrew.diff https://raw.github.com/gist/1012927 -o 002-homebrew.diff | |
######################################################################## 100.0% | |
######################################################################## 100.0% | |
==> Patching | |
/usr/bin/patch -f -p1 -i 001-homebrew.diff |
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
# clone svn repo, -s means standar svn repo (trunk, branches, tags) | |
$ git svn clone file:///tmp/test-svn -s | |
# branches list | |
$ git branch -a | |
$ git repack -d | |
# creates and jump to the new branch | |
$ git checkout -b new_branch | |
# add changes | |
$ git add <FILE> | |
# commit changes to the current branch |
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
$ brew install soprano | |
==> Downloading http://downloads.sourceforge.net/project/soprano/Soprano/2.6.0/soprano-2.6.0.tar.bz2 | |
File already downloaded in /Users/nebiros/Library/Caches/Homebrew | |
==> cmake . -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/soprano/2.6.0' -DCMAKE_BUILD_TYPE=None -Wno-dev | |
-- The C compiler identification is GNU | |
-- The CXX compiler identification is GNU | |
-- Checking whether C compiler has -isysroot | |
-- Checking whether C compiler has -isysroot - yes | |
-- Checking whether C compiler supports OSX deployment target flag | |
-- Checking whether C compiler supports OSX deployment target flag - yes |