Skip to content

Instantly share code, notes, and snippets.

Doing evil things, probably. Sorry...

James Titcumb asgrim

Doing evil things, probably. Sorry...
View GitHub Profile
asgrim / GDLiveHeaders
Created Aug 23, 2011
GoDeploy deploy/run HTTP headers
View GDLiveHeaders
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: 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
View AdminController-Current.php
class AdminController extends Zend_Controller_Action
public function userAction()
$users = new GD_Model_UsersMapper();
$user = new GD_Model_User();
asgrim / gist:1332315
Created Nov 1, 2011
Excerpts from GD_Config::set
View gist:1332315
$bind = array(
'key' => $key,
'value' => $value,
$where['key = ?'] = $key;
$db = Zend_Db_Table::getDefaultAdapter()
$db->update('configuration', $bind, $where);
asgrim / index.php
Created Jul 30, 2012
Crazy Morse-encoded PHP executor. Dirty and quick, no apologies for this code.
View index.php
require 'morselib.php';
$morse = new morselib();
View EveryPage.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
View AbstractController.php
abstract class AbstractController
public function dispatch($action)
$actionName = $action . "Action";
if (!method_exists($this, $actionName))
View MyForm.php
namespace Vendor\Form;
use Zend\Form\Form;
use Zend\Form\Element;
use Zend\Form\Annotation\InputFilter;
use Zend\InputFilter\InputFilterProviderInterface;
class MyForm extends Form implements InputFilterProviderInterface
View uaseragents.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 2 columns, instead of 3. in line 1.
2347,Mozilla/5.0 (compatible; monitis - premium monitoring service;
910,Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML, like Gecko) Version/ Safari/536.2+
206,Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US); 0110120602120527
89,ClickTale bot
41, robot
35,Mozilla/5.0 (BB10; Kbd) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ Mobile Safari/537.10+
33,Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ Mobile Safari/537.10+
31,Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ Mobile Safari/537.10+
25,Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/ Mobile Safari/537.10+
View chrome26.ini
;;; Provided courtesy of
;;; Created on Monday, July 29, 2013 at 10:22 PM UTC
;;; Keep up with the latest goings-on with the project:
;;; Follow us on Twitter <>, or...
;;; Like us on Facebook <>, or...
;;; Collaborate on GitHub <>, or...
;;; Discuss on Google Groups <>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Browscap Version
View LoggerAwareTrait.php
namespace My\Logger;
use Psr\Log\LoggerInterface;
trait LoggerAwareTrait
/** @var \Psr\Log\LoggerInterface */
protected $logger;