Skip to content

Instantly share code, notes, and snippets.

sudo apt-get install zlib1g zlib1g-dev zlib-bin zlibc
@lukearmstrong
lukearmstrong / gist:1957982
Created March 2, 2012 11:54
Ant CSS/JS Compressor
<?xml version="1.0" ?>
<project default="js.minify" basedir=".">
<target name="load.properties">
<echo>Initialize Variables</echo>
<property name="public.path" value="httpdocs" />
<echo message="public.path: ${public.path}" />
<property name="yuiCompressor.path" value="includes/build/yuicompressor-2.4.6.jar" />
@lukearmstrong
lukearmstrong / gist:1958085
Created March 2, 2012 12:20
Fuel Template Head
<? IF (Fuel::$env === Fuel::DEVELOPMENT): ?>
<link rel="stylesheet" type="text/css" href="/css/boilerplate/1-reset.css" />
<? FOREACH (File::read_dir(DOCROOT.'css/screen') as $_file): ?>
<link rel="stylesheet" type="text/css" href="/css/screen/<?= $_file ?>" />
<? ENDFOREACH; ?>
<link rel="stylesheet" type="text/css" href="/css/boilerplate/2-helpers.css" />
<link rel="stylesheet" type="text/css" href="/css/boilerplate/3-responsive.css" />
<? FOREACH (File::read_dir(DOCROOT.'css/responsive') as $_file): ?>
<link rel="stylesheet" type="text/css" href="/css/responsive/<?= $_file ?>" />
<? ENDFOREACH; ?>
@lukearmstrong
lukearmstrong / gist:1999912
Created March 8, 2012 09:28
PHP UK Conference 2012
PHP UK Conference 2012
https://joind.in/event/view/824
Great Talks
Well Organised
Kept me watered
Great Food
Free Beer
I didn't catch a PHP Elephant plushie :(
I didn't win an O'Reilly Book :(
@lukearmstrong
lukearmstrong / 001_create_users.php
Created March 8, 2012 09:43
Migrations Example
<?php
namespace Fuel\Migrations;
class Create_Users
{
protected static $users_table;
public function __construct()
{
git add .
git ls-files --deleted | xargs git rm
<?php
class Controller_Error extends Controller_Template
{
public function action_404()
{
// XXX: https://github.com/fuel/core/issues/515
// I assume the line below only works when using PHP as an Apache Module as the 404 header is different for FastCGI.
//$this->response->status = 404;
<?php
$var = array();
if (!empty($var)) {
// This is wrong?
}
if ($var) {
// This is better?
<?php
// Controller
$customers = array(
'alan',
'luke'
);
// Imagine $orders may be undefined, null or false.
@lukearmstrong
lukearmstrong / .gitconfig
Last active October 3, 2015 18:08
.gitconfig
[alias]
addr = add -A .
ci = commit
co = checkout
ff = merge --ff-only
lg = log --graph --decorate --branches --oneline --remotes --tags --all -20
lga = log --graph --decorate --branches --oneline --remotes --tags --all
st = status
[color]