Skip to content

Instantly share code, notes, and snippets.

View kirkegaard's full-sized avatar

Christian Kirkegaard kirkegaard

View GitHub Profile
"Europe/Andorra",
"Asia/Dubai",
"Asia/Kabul",
"America/Antigua",
"America/Anguilla",
"Europe/Tirane",
"Asia/Yerevan",
"America/Curacao",
"Africa/Luanda",
"Antarctica/McMurdo",
- simple
- public over private
- personal vanity
- internet is global
- permalinks
- one important item per page
- don't break the browser
- don't wanker in technology
- a medium is not a grande
- break convention for your users
<?php
class App_Controller_Plugin_LayoutSwitcher extends Zend_Layout_Controller_Plugin_Layout {
public function preDispatch(Zend_Controller_Request_Abstract $request) {
$this->getLayout()->setLayoutPath(
Zend_Controller_Front::getInstance()->getModuleDirectory(
$request->getModuleName()
) . '/views/layouts'
);
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# application/modules/backend/views/
# application/modules/frontend/
nothing added to commit but untracked files present (use "git add" to track)
Exception information:
Message: Unknown method Model_Page::findAll
Stack trace:
#0 [internal function]: Doctrine_Record->__call('findAll', Array)
#1 /Users/ranza/Sites/1kid/application/modules/backend/controllers/PageController.php(19): Model_Page->findAll()
#2 /Applications/MAMP/bin/php5/lib/php/Zend/Controller/Action.php(513): Backend_PageController->indexAction()
#3 /Applications/MAMP/bin/php5/lib/php/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('indexAction')
function showOptions() {
echo "Please select install method:"
echo "1) SVN"
echo "2) GIT"
echo "3) HTTP"
read opt;
case ${opt} in
1) METHOD="SVN";;
2) METHOD="GIT";;
@kirkegaard
kirkegaard / install_wordpress.sh
Created March 16, 2010 09:36
installs wordpress in your current directory
#!/bin/bash
CURRENT_PATH=`pwd`
INSTALL_FOLDER="public_html"
METHOD="HTTP"
HTTP_SOURCE="http://wordpress.org/latest.tar.gz"
SVN_SOURCE="http://core.svn.wordpress.org/trunk/"
trap cleanup INT
@kirkegaard
kirkegaard / install_wordpress.sh
Created March 16, 2010 10:44
install wordpress from a selected source
#!/bin/bash
CURRENT_PATH=`pwd`
INSTALL_FOLDER="public_html"
METHOD="HTTP"
HTTP_SOURCE="http://wordpress.org/latest.tar.gz"
SVN_SOURCE=""
SVN_SOURCE_BASE="http://core.svn.wordpress.org"
SVN_SOURCE_STABLE="/tags/2.9.2/"
SVN_SOURCE_TRUNK="/trunk/"
function getDaysOfMonth(year, month) {
return 32 - new Date(year, month, 32).getDate();
}
<?php
protected function _initRestRoute() {
$this->bootstrap('frontController');
$frontController = Zend_Controller_Front::getInstance();
$restRoute = new Zend_Rest_Route($frontController, array(), array(
'api',
'planner' => array('event'),
));
$frontController->getRouter()->addRoute('rest', $restRoute);