Skip to content

Instantly share code, notes, and snippets.

View asgrim's full-sized avatar
😈
Doing evil things, probably. Sorry...

James Titcumb asgrim

😈
Doing evil things, probably. Sorry...
View GitHub Profile
<?php
abstract class AbstractController
{
public function dispatch($action)
{
$actionName = $action . "Action";
if (!method_exists($this, $actionName))
{
@asgrim
asgrim / EveryPage.php
Created October 26, 2012 08:38
every page
<?php
namespace EveryPage\Controller\Plugin;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\Mvc\Controller\Plugin\AbstractPlugin;
class EveryPage extends AbstractPlugin implements ServiceLocatorAwareInterface
{
@asgrim
asgrim / index.php
Created July 30, 2012 07:25
Crazy Morse-encoded PHP executor. Dirty and quick, no apologies for this code.
<?php
require 'morselib.php';
$morse = new morselib();
eval($morse->decode(file_get_contents("site.morse")));
@asgrim
asgrim / gist:1332315
Created November 1, 2011 23:56
Excerpts from GD_Config::set
<?php
$bind = array(
'key' => $key,
'value' => $value,
);
$where['key = ?'] = $key;
$db = Zend_Db_Table::getDefaultAdapter()
$db->update('configuration', $bind, $where);
@asgrim
asgrim / AdminController-Current.php
Created November 1, 2011 15:09
ZF coding standards
<?php
class AdminController extends Zend_Controller_Action
{
public function userAction()
{
$this->view->headLink()->appendStylesheet("/css/template/form.css");
$this->view->headLink()->appendStylesheet("/css/pages/project_servers.css");
$users = new GD_Model_UsersMapper();
$user = new GD_Model_User();
@asgrim
asgrim / GDLiveHeaders
Created August 23, 2011 07:29
GoDeploy deploy/run HTTP headers
http://godeploy.localhost/project/https-git-repo-test/deploy/run/79
GET /project/https-git-repo-test/deploy/run/79 HTTP/1.1
Host: godeploy.localhost
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.20) Gecko/20110805 Ubuntu/10.04 (lucid) Firefox/3.6.20
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115