Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| #This is the "site config" for nginx | |
| upstream django { | |
| # Distribute requests to servers based on client IP. This keeps load | |
| # balancing fair but consistent per-client. In this instance we're | |
| # only using one uWGSI worker anyway. | |
| ip_hash; | |
| server unix:/tmp/uwsgi.sock; | |
| } | |
| server { |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| # If not running interactively, don't do anything | |
| [ -z "$PS1" ] && return | |
| # simple history browsing | |
| export HISTCONTROL=erasedups | |
| export HISTSIZE=10000 | |
| shopt -s histappend | |
| bind '"\e[A"':history-search-backward | |
| bind '"\e[B"':history-search-forward |
The following describes the mandatory requirements that must be adhered to for autoloader interoperability.
\ <Vendor Name> \ (<Namespace>)* \ <Class Name>DIRECTORY_SEPARATOR when loading from the file system.DIRECTORY_SEPARATOR. The "_" character has no special meaning in the namespace.| # subversion | |
| .subversion | |
| # mirror dirs | |
| /mirror/* | |
| /tmp/* |
| # basic bash completion for yiic command | |
| # | |
| # simply add the following to your ~/.bash_profile | |
| # | |
| # . ~/path/to/this/file/yiic_bash_completion.bash | |
| # | |
| # note: the . is relevant and you probably have to adjust the path ;-) | |
| # | |
| _yiic() |
| <?php | |
| /** | |
| * Yii, simple HMVC | |
| */ | |
| class HmvcController extends Controller | |
| { | |
| public function actionIndex() | |
| { | |
| echo $this->execute('/hmvc/do/id/123'); | |
| } |
| #!/bin/bash | |
| [[ $1 ]] || { | |
| echo "Usage: fix-profile.sh [path to callgrind file]" | |
| exit 1 | |
| } | |
| egrep -v '^(cfl|positions|creator)' $1 | sed -e 's/^-//;1s/1/0.9.6/' > $1.fixed | |
| <?php | |
| /** | |
| * Q: | |
| * | |
| * Hi, could please add this feature please. Here is my case, I have two themes | |
| * and I have modules. How can one set each view file in the modules to use | |
| * either one of the themes. Such if the view is admin use backoffice theme and | |
| * if view is index use siteNew theme. I so someting like setBasePath and | |
| * setBaseUrl but I don not know where they should be exactly. | |
| * |
| #!/bin/sh | |
| # Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
| # CREATE block and create them in separate commands _after_ all the INSERTs. | |
| # Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
| # The mysqldump file is traversed only once. | |
| # Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
| # Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |