Skip to content

Instantly share code, notes, and snippets.

View morgan's full-sized avatar

Michael Morgan (Mícheál) morgan

View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@morgan
morgan / location-hashbang.js
Last active July 16, 2016 13:20
Make S3 website hosting and multiple EmberJS applications play well together by using a hashbang without sacrificing pretty URLs! This initializer removes the hashbang from the Ember URL while preserving the nested route.
/**
`location-hashbang.js` checks for the presence of a `#!` hashbang,
removes it and updates the location without a page reload
or history modification.
Create initializer as follows: `app/initializers/location-hashbang.js`
See `s3-redirection-rules.xml` for sample rules.
Tested with Ember 2.6.0
@morgan
morgan / RouteTest.php
Created July 20, 2012 04:41
Stack Overflow Answer: How to add a Route to the beginning of the stack in Kohana.
<?php defined('SYSPATH') OR die('Kohana bootstrap needs to be included before tests run');
/**
* Tests Route extension
*
* @group route
* @category Tests
* @author Micheal Morgan <micheal@morgan.ly>
* @copyright (c) 2012 Micheal Morgan
* @license MIT
*/
@morgan
morgan / arr.php
Created July 8, 2012 19:56
Kohana array helper: an alternative to array_push that returns the result instead of handling the first argument by reference.
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Arr transparently extended. Place in "classes" directory of Kohana 3+ application or module.
*
* @author Micheal Morgan <micheal@morgan.ly>
* @copyright (c) 2012 Micheal Morgan
* @license MIT
*/
class Arr extends Kohana_Arr
{
@morgan
morgan / config.php
Last active October 6, 2015 22:18
Kohana config to file helper.
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Config transparently extended. Place in "classes" directory of Kohana 3+ application or module.
*
* @author Micheal Morgan <micheal@morgan.ly>
* @copyright (c) 2012-2013 Micheal Morgan
* @license MIT
*/
class Config extends Kohana_Config
{