Skip to content

Instantly share code, notes, and snippets.

View matoakley's full-sized avatar

Matt Oakley matoakley

View GitHub Profile
@matoakley
matoakley / date.php
Created April 19, 2011 15:36
Extend Kohana's Date helper to return month given as integer to string
<?php defined('SYSPATH') or die('No direct script access.');
class Date extends Kohana_Date
{
/**
* Take a numerical representation of a month (e.g. '04') and return it as a human readable string (e.g. 'April')
*
* @param mixed numerical representation of month
* @return string
*/
@matoakley
matoakley / gist:1092571
Created July 19, 2011 14:38
MySQL to convert a string into a slug
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name`

Ruby Technical Evaluation

Code quality is very important to us. We're sending you this challenge so that we can evaluate your coding skills with Ruby.

What we expect from your code

  • Object-oriented
  • Clean code
  • Consistent style