Skip to content

Instantly share code, notes, and snippets.

View maetl's full-sized avatar

Mark Rickerby maetl

View GitHub Profile
@maetl
maetl / gist:946129
Created April 28, 2011 10:23
phpDocumentor.ini
;; phpDocumentor parse configuration file
;;
;; This file is designed to cut down on repetitive typing on the command-line or web interface
;; You can copy this file to create a number of configuration files that can be used with the
;; command-line switch -c, as in phpdoc -c default.ini or phpdoc -c myini.ini. The web
;; interface will automatically generate a list of .ini files that can be used.
;;
;; default.ini is used to generate the online manual at http://www.phpdoc.org/docs
;;
;; ALL .ini files must be in the user subdirectory of phpDocumentor with an extension of .ini
@maetl
maetl / gist:946143
Created April 28, 2011 10:36
Properties.php
<?php
/**
* From: http://www.innerweaver.com/articles/php-java-properties
*
* PHP Version of the class java.util.Properties. Loads and saves Java
* .properties files.
*
* The methods inherited from Hashtable are not implemented, as they are
* merely another interface to the same functionality. The save method is not
@maetl
maetl / gist:949816
Created April 30, 2011 17:16
PHP Reflection API
ReflectionClass — The ReflectionClass class
ReflectionClass::__clone — Clones object
ReflectionClass::__construct — Constructs a ReflectionClass
ReflectionClass::export — Exports a class
ReflectionClass::getConstant — Gets defined constants
ReflectionClass::getConstants — Gets constants
ReflectionClass::getConstructor — Gets constructor
ReflectionClass::getDefaultProperties — Gets default properties
ReflectionClass::getDocComment — Gets doc comments
ReflectionClass::getEndLine — Gets end line
@maetl
maetl / gist:954737
Created May 4, 2011 04:01
asciiiiiiiiiiiiiiiiiiiiiiiiiii
/**
* Test ridiculous UML diagrams embedded in comments:
*
* +-------------+ +----------------+
* | MyBaseClass |--------:>| MyCollaborator |
* +------.------+ +----------------+
* /_\
* |
@maetl
maetl / gist:1037687
Created June 21, 2011 11:44
Postmodern Essay Grammar
// pomo.pb acb ??-09-24 AU
// pb script for generating postmodern verbiage
// Updated, format-independent version
// Copyright (C) 1995, 1996 Andrew C. Bulhak
// this script is property of acb. You are permitted to use, modify and
// distribute it as long as this notice is retained and any modifications
// in distributed copies are clearly denoted.
// if we're using troff, we want two columns
@maetl
maetl / gist:1245106
Created September 27, 2011 13:57
PHP Reserved Words
<?php
function is_reserved_word($word)
{
return (in_array($word, array(
"abstract",
"and",
"array",
"as",
"break",
@maetl
maetl / gist:1312672
Created October 25, 2011 13:09
Epiphyte Syntax for TextMate
{ scopeName = 'source.epiphyte';
fileTypes = ( 'phyte' );
foldingStartMarker = '(client|resource|collection).*$';
foldingStopMarker = '^\s*end';
patterns = (
{ name = 'keyword.other.declaration';
match = '\b(collection|end)\b';
},
{ name = 'meta.client.epiphyte';
match = '(client)(\s+[A-Za-z0-9\_]+)*';
String::endsWith = (s) -> this[this.length-s.length...] == s
@maetl
maetl / geography_model.js
Created September 3, 2013 11:03
Mozart models in raw JS... can they work?
var Geography;
window.Geography = this.Geography = Geography = {};
Geography.Country = Mozart.Model.create({
modelName: "Country"
});
Geography.Country.attributes({
name: "string",
@maetl
maetl / gist:8914783
Created February 10, 2014 12:10
Heroku Ruby/Bower buildpack with branch that fixes the caching race condition bullshit from Bower
heroku config:set BUILDPACK_URL=git://github.com/qnyp/heroku-buildpack-ruby-bower.git#workaround-for-bower-cache-bug