Skip to content

Instantly share code, notes, and snippets.

Avatar
😈
Doing evil things, probably. Sorry...

James Titcumb asgrim

😈
Doing evil things, probably. Sorry...
View GitHub Profile
@asgrim
asgrim / GDLiveHeaders
Created Aug 23, 2011
GoDeploy deploy/run HTTP headers
View GDLiveHeaders
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
View AdminController-Current.php
<?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 / gist:1332315
Created Nov 1, 2011
Excerpts from GD_Config::set
View gist:1332315
<?php
$bind = array(
'key' => $key,
'value' => $value,
);
$where['key = ?'] = $key;
$db = Zend_Db_Table::getDefaultAdapter()
$db->update('configuration', $bind, $where);
@asgrim
asgrim / index.php
Created Jul 30, 2012
Crazy Morse-encoded PHP executor. Dirty and quick, no apologies for this code.
View index.php
<?php
require 'morselib.php';
$morse = new morselib();
eval($morse->decode(file_get_contents("site.morse")));
View EveryPage.php
<?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
<?php
abstract class AbstractController
{
public function dispatch($action)
{
$actionName = $action . "Action";
if (!method_exists($this, $actionName))
{
View MyForm.php
<?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; http://www.monitis.com)
910,Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML, like Gecko) Version/7.2.1.0 Safari/536.2+
678,checks.panopta.com
206,Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US); 0110120602120527
89,ClickTale bot
41,AddThis.com robot tech.support@clearspring.com
35,Mozilla/5.0 (BB10; Kbd) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.2342 Mobile Safari/537.10+
33,Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.2354 Mobile Safari/537.10+
31,Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.10.690 Mobile Safari/537.10+
25,Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.1720 Mobile Safari/537.10+
View chrome26.ini
;;; Provided courtesy of https://browsers.garykeith.com
;;; 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 <https://twitter.com/browscap>, or...
;;; Like us on Facebook <https://facebook.com/browscap>, or...
;;; Collaborate on GitHub <https://github.com/GaryKeith/browscap>, or...
;;; Discuss on Google Groups <https://groups.google.com/d/forum/browscap>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Browscap Version
View LoggerAwareTrait.php
<?php
namespace My\Logger;
use Psr\Log\LoggerInterface;
trait LoggerAwareTrait
{
/** @var \Psr\Log\LoggerInterface */
protected $logger;