Skip to content

Instantly share code, notes, and snippets.

View joshuamorse's full-sized avatar

Joshua Morse joshuamorse

View GitHub Profile
@joshuamorse
joshuamorse / RequestMirror.php
Created December 19, 2012 21:23
A Request Mirror Script in PHP
<?php
/**
* A simple script that acts as a request mirror.
* It will return a JSON object containing all sorts of information
* relating to the request it received.
*/
$url = 'http://';
if (isset($_SERVER['HTTPS'])) {
@joshuamorse
joshuamorse / bar.bash
Created January 9, 2012 17:26
Symfony2 "build --all --and-load" ~equivalent
# ...where con = php app/console
con doctrine:database:drop --force;
con doctrine:database:create;
con doctrine:schema:create;
con doctrine:fixtures:load
@joshuamorse
joshuamorse / install.php
Created January 4, 2012 17:16
Project Install Script
#!/usr/bin/env php
<?php
/**
* A simple script to get newly-cloned project up and running quickly.
*
* The general idea: we spend lots of time copying files/creating dirs
* when setting up new projects. This script will do most all of that for us.
*
* @author Joshua Morse <dashvibe@gmail.com>
@joshuamorse
joshuamorse / install.php
Created December 30, 2011 15:50
Install Script Idea
#!/usr/bin/env php
<?php
/**
* A convinient way to get a Silex project up and running quickly.
* Currently incomplete.
*
* @author Joshua Morse <dashvibe@gmail.com>
*/
@joshuamorse
joshuamorse / Fibonacci Position Function
Created April 10, 2011 20:57
Returns the result of a supplied position in the Fibonacci Sequence
<?php
/**
* Returns the result of a supplied position in the Fibonacci Sequence.
*
* @param mixed $n
* @access public
* @return integer
*/
function get_fibonacci_position($n)