Skip to content

Instantly share code, notes, and snippets.

View camfindlay's full-sized avatar

Cam Findlay camfindlay

View GitHub Profile
@AshKyd
AshKyd / go.sh
Last active August 29, 2015 14:15
Silverstripe with sqlite3 dev environment on Fedora (PHP 5.4+)
# Fedora-specific PHP environment setup
yum install php php-mbstring php-mysql php-gd
# Manually install composer via https://getcomposer.org/download/
# Install Silverstripe & sqlite driver
composer create-project silverstripe/installer ./ 3.1.10
composer require silverstripe/sqlite3 1.3.*@dev
# Launch the dev PHP server
@jedateach
jedateach / _ss_environment.php
Created May 16, 2014 21:45
Localhost ss environment file
<?php
//set up reporting level, depending on ss version
if(strrpos($_SERVER['SCRIPT_NAME'], 'sapphire') !== false){
error_reporting(E_ERROR | E_WARNING | E_PARSE);
}else{
error_reporting(E_ALL);
}
define('SS_GEM_PATH', '/usr/bin/');
@ss23
ss23 / gist:9852996
Last active August 29, 2015 13:57
Draft of how to audit SilverStripe code

Whitebox

Folder structure isn't easy to notice at first. Generally, each folder is a "module" (where framework is core SilverStripe, cms is the CMS part of core SilverStripe, and mysite is the custom code). There's also a /vendor directory that might be used if they're using composer. If they're using Composer you'll be able to use the composer.json file in the root of the project to determine where some folders are coming from and if they're using official modules, etc. Extra points if you checking their live webserver and find access to it. Information disclosure and all that.

Most of the interesting code will be in mysite/ probably (though worth noting, there's no explicit rule that you have to put your code in a folder called that -- another common option is to put in a folder named after the project). CMS and Framework are the only two modules you probably won't need to audit or worry about, however, it's fairly common for developers (especially ones not fa

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: