Skip to content

Instantly share code, notes, and snippets.

View cebe's full-sized avatar
☁️
working on cebe.cloud

Carsten Brandt cebe

☁️
working on cebe.cloud
View GitHub Profile
@drawks
drawks / graphite
Created February 14, 2012 21:24
Graphite on uwsgi/nginx
#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 {
@ziadoz
ziadoz / awesome-php.md
Last active May 8, 2025 07:37
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@cebe
cebe / .bashrc
Last active September 19, 2016 18:16
.bashrc + .vimrc
# 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
@Thinkscape
Thinkscape / PSR-0-final-proposal.md
Created September 22, 2011 10:30
PSR-0 Final Proposal (PHP Standards Working Group)

PSR-0 Final Proposal (PHP Standards Working Group)

The following describes the mandatory requirements that must be adhered to for autoloader interoperability.

Mandatory:

  • A fully-qualified namespace and class must have the following structure \ <Vendor Name> \ (<Namespace>)* \ <Class Name>
  • Each namespace must have a top-level namespace ("Vendor Name").
  • Each namespace can have as many sub-namespaces as it wishes.
  • Each namespace separator is converted to a DIRECTORY_SEPARATOR when loading from the file system.
  • Each "_" character in the CLASS NAME is converted to a DIRECTORY_SEPARATOR. The "_" character has no special meaning in the namespace.
@cebe
cebe / .gitignore
Created August 19, 2011 14:32
script to mirror svn repository
# subversion
.subversion
# mirror dirs
/mirror/*
/tmp/*
@cebe
cebe / yiic_bash_completion.bash
Created August 11, 2011 23:19
yiic bash completion
# 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()
@samdark
samdark / HmvcController.php
Created August 3, 2011 22:36
Yii: Simple HMVC
<?php
/**
* Yii, simple HMVC
*/
class HmvcController extends Controller
{
public function actionIndex()
{
echo $this->execute('/hmvc/do/id/123');
}
@smerrill
smerrill / fix-profile.sh
Created August 2, 2011 21:59
Fix an XDebug 2.1.1 (or later) callgrind file to be usable with XDebugToolkit
#!/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
@samdark
samdark / gist:1001489
Created May 31, 2011 23:36
Yii: switching theme based on view name
<?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.
*
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/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