Skip to content

Instantly share code, notes, and snippets.

View andypearson's full-sized avatar

Andy Pearson andypearson

View GitHub Profile
@andypearson
andypearson / film-list.md
Last active August 29, 2015 14:23
Films

Films that I haven't watched

  • Black Pond
  • Enternal sunshine of a spotless mind
  • Tyrannosaurus
  • Take Shelter
  • Life of Brian
  • Meaning of Life
  • Search for the Holy Grail
  • Shame
<?php
// Heredoc Syntax
// For more info: http://us3.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
echo <<<EOT
This is a block of text.
EOT;
// Breaking PHP tags
@andypearson
andypearson / Useful Commands
Created January 24, 2009 12:53
A whole bunch of useful commands which I can never remember or am too lazy to type
# Edit the Hosts file on OSX (I always forget this...)
mate /private/etc/hosts
# Run cucumber and rspec using autotest
AUTOFEATURE=true autospec
# Install Rails BDD Suite
sudo gem install rspec rspec-rails cucumber webrat
# Update Rails
Last login: Mon Jan 26 18:53:57 on console
Captain-Dread:~ andypearson$ cd 0working/github
Captain-Dread:github andypearson$ rails formtastic_example
create
create app/controllers
create app/helpers
...
...
Captain-Dread:github andypearson$ cd formtastic_example
Captain-Dread:formtastic_example andypearson$ script/plugin install git://github.com/justinfrench/formtastic.git
<?php
/*
* Database Class
* Created by - Andy Pearson
* Date - 20.02.07
*/
class db
{
%y%m%d-__DB__
%y%m%d-__DB__-__TABLE__
/*
Name: Reset CSS
Author: Eric Meyer
URI: http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
# Using Filter branch to remove a file from entire repository history
git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename' HEAD
rm -r .git/refs/original
body {
font:62.5%/1.5 Helvetica, Arial, sans-serif;
}
/* ---- Clearfix */
.clearfix:after {
content:".";
display:block;
height:0;
<?php
$photos = array(
'one.jpg',
'two.jpg',
'three.jpg',
'four.jpg',
'five.jpg'
);
$photo = $photos[array_rand($photos)];