Skip to content

Instantly share code, notes, and snippets.

View amacgregor's full-sized avatar
:shipit:
Working on Side Projects

Allan MacGregor amacgregor

:shipit:
Working on Side Projects
View GitHub Profile
<?php
namespace Goose\Modules\Formatters;
use Goose\Article;
use Goose\Traits\NodeCommonTrait;
use Goose\Traits\NodeGravityTrait;
use Goose\Traits\ArticleMutatorTrait;
use Goose\Modules\AbstractModule;
use Goose\Modules\ModuleInterface;
cd hhvm
git submodule update
export HPHP_HOME=`pwd`
cmake .
make
@amacgregor
amacgregor / example.hdf
Created February 9, 2014 15:23
Example
Server {
Port = 9090
Type = fastcgi
SourceRoot = /srv/www/mysite/com/public_html
DefaultDocument = index.php
IniFile = config.ini
}
Eval {
Jit = true
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;

Project

Description: What does this project do and who does it serve?

Project Setup

How do I, as a developer, start working on the project?

  1. What dependencies does it have (where are they expressed) and how do I install them?
  2. How can I see the project working before I change anything?
Usage:
hhvm [-m <mode>] [<options>] [<arg1>] [<arg2>] ...
Options:
--help display this message
--version display version number
--php emulate the standard php command line
--compiler-id display the git hash for the compiler
--repo-schema display the repository schema id
@amacgregor
amacgregor / svn-commit.sh
Last active August 29, 2015 13:56
Easy SVN commits
#!/bin/bash
# Created by: syphoxy
SVN_COMMIT_FILES="$(mktemp /tmp/svn-commit-files.XXXXX)"
svn status \
| awk '{ $1 = ""; print $0 }' \
| sed -Ee 's/^[ ]+//; s/[ ]+$//' > "$SVN_COMMIT_FILES" \
&& [ -f "$SVN_COMMIT_FILES" ] \
&& [ "$(wc -l < "$SVN_COMMIT_FILES")" -ge 1 ] \
&& vim "$SVN_COMMIT_FILES" \
var CreditCard = {
CARDS: {
Visa: /^4[0-9]{12}(?:[0-9]{3})?$/,
MasterCard: /^5[1-5][0-9]{14}$/,
DinersClub: /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,
Amex: /^3[47][0-9]{13}$/,
Discover: /^6(?:011|5[0-9]{2})[0-9]{12}$/
},
TEST_NUMBERS: $w('378282246310005 371449635398431 378734493671000 '+
'30569309025904 38520000023237 6011111111111117 '+
@amacgregor
amacgregor / mutliple_inheritance_traits.php
Created March 15, 2014 20:03
Using traits for multiple inheritance in php
<?php
class Animal {
public function roar() {
echo "Makes animal sounds";
}
}
trait Cat {
public function roar() {
@amacgregor
amacgregor / multiple_traits.php
Created March 15, 2014 20:15
Multiple Traits
<?php
class Animal {
public function roar() {
echo "Makes animal sounds";
}
}
trait Cat {
public function roar() {