Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Working on Side Projects

Allan MacGregor amacgregor

:shipit:
Working on Side Projects
View GitHub Profile
View OutputFormatter.php
<?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;
View hhvm_build
cd hhvm
git submodule update
export HPHP_HOME=`pwd`
cmake .
make
View example.hdf
Server {
Port = 9090
Type = fastcgi
SourceRoot = /srv/www/mysite/com/public_html
DefaultDocument = index.php
IniFile = config.ini
}
Eval {
Jit = true
View gist:8906328
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;
View readme.markdown

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?
View hhvm_help_output
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 Aug 29, 2015
Easy SVN commits
View svn-commit.sh
#!/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" \
View gist:9415727
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 / multiple_traits_extend.php
Last active Aug 29, 2015
Multiple traits extended example
View multiple_traits_extend.php
<?php
class Animal {
public function roar() {
echo "Makes animal sounds";
}
}
trait Feline {
public function roar() {
View multiple_traits.php
<?php
class Animal {
public function roar() {
echo "Makes animal sounds";
}
}
trait Cat {
public function roar() {
You can’t perform that action at this time.