Skip to content

Instantly share code, notes, and snippets.

View aderowbotham's full-sized avatar
👽

Adrian Rowbotham aderowbotham

👽
View GitHub Profile
@aderowbotham
aderowbotham / django_ami.md
Created June 7, 2012 14:19
Django stack setup on EC2 AMI

Django Stack

Overview

This is a set of instructions to setup a Django Nginx Gunicorn MySQL/Postgres stack on a single Amazon EC2 instance.

Server - AWS

@aderowbotham
aderowbotham / pirata_associate_tech_director_2012-09.md
Created September 19, 2012 14:01
Pirata Job Specification: Associate Technical Director

#Pirata Logo

http://piratalondon.com | September 2012

##Associate Technical Director

We've got a brand new opening for a senior someone who can bring technical experience, client­facing skills and team leadership to the table. Pirata is changing as we branch out into exciting new types of work, and you will be expected to help us shape the technical team as we continue to make that transition.

A background in technical project management is something we're very keen on here, although we are also considering candidates with more of a hands­on development background. In either case it is expected that you will be familiar with a wide range of development languages, tools, platforms and content management systems.

@aderowbotham
aderowbotham / pirata_tech_lead_2012-09.md
Created September 19, 2012 14:04
Pirata Job Specification: Technical Lead

#Pirata Logo

http://piratalondon.com | September 2012

##Technical Lead

We're looking for a Technical Lead with a wealth of web or app development experience. You will be expected to show incredible attention to detail and be able to understand and solve problems in the context of the bigger picture.

You will be expected to show leadership qualities and be able to oversee small teams of developers across a range of projects. You'll also be required to communicate often complicated concepts to clients without blinding them with acronyms and jargon. You'll ideally have several years experience in back-end development preferably with Python / Django or one or more PHP frameworks or content management systems. You will get involved with hands-on development at times, though this will likely comprise less than a third of each working week.

@aderowbotham
aderowbotham / php_argv_environment.php
Created November 25, 2012 17:37
PHP / Codeigniter - set environment when running in CLI mode
<?php
# in public_html/index.php
/*
* Where your CodeIgniter ENVIRONMENT is normally defined by the server environment
* variables, and assuming your database settings are automatically set based on
* that environment, this causes a problem when running the application through
* PHP on the command line e.g. in order to run CodeIgniter Migrations
*
@aderowbotham
aderowbotham / dev_tools.md
Last active October 13, 2015 21:20
Developers' Tools

##Developers’ Tools

I’ve created this list as a place to capture some of the handy tools that frequently get shared among developers.

Note: the category anchors were working yesterday, but seem to have stopped working today. GitHub is no longer rendering anchor tags at each header. If anyone knows of a solution let me know!

#####Categories

@aderowbotham
aderowbotham / formatted-print_r.php
Last active July 5, 2023 13:36
PHP debugging shortcut for '<pre>' + print_r() + die(), that formats keys in red and values in blue.
# colour-formatted print_r shortcut
if ( ! function_exists('prd')){
function prd($object,$die=TRUE){
# insert span tags
$output = '<span class="die_value">'.$output;
$output = str_replace('[', '<span class="die_key">[', print_r($object,TRUE));
$output = str_replace(']', ']</span>', $output);
$output = str_replace('=> ', '=> <span class="die_value">', $output);
@aderowbotham
aderowbotham / purge-ban-domain-varnish.md
Last active May 24, 2022 19:55
Purge (ban) an entire domain in Varnish Cache 3

How to purge ('ban') an entire domain in Varnish Cache 3

#####EDIT: NB Ban is technically different from Purge. Banned objects remain in memory but banning is faster than purging. Read the Varnish 3 documentation here and here.

Purge may be a more appropriate action for your use-case; although the examples in the gist below work, it's not necessarily the best way of doing this.


# Copied from http://kly.no/varnish/regex.txt
# Thanks to Kristian Lyngstøl / @KristianLyng for putting this together
Regular expression cheat sheet for Varnish
Varnish regular expressions are NOT case sensitive. Varnish uses POSIX
regular expressions, for a complete guide, see: "man 7 regex"
Basic matching:
@aderowbotham
aderowbotham / mobile_not_implemented.css
Created July 3, 2013 09:19
mobile layout not implemented notification message (for sites in development)
/* mobile
============================================================================================== */
@media screen and (min-width: 0) and (max-width: 700px) {
/* hide everything */
div, span, p
{
display: none;
}
body:before {