A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
<?php | |
class Base_Controller extends Controller { | |
public $layout = 'layouts.main'; | |
public function __construct(){ | |
//Styles | |
Asset::add('css', 'css/main.css'); |
# In your app's root. | |
# Make Pow!! export all the env variables contained in the .env file used by Foreman. | |
export $(cat .env) |
<?php | |
class CustomHelpers | |
{ | |
/** | |
* | |
* ---------------------------------------------- | |
* Create a Title from a route | |
* ---------------------------------------------- |
$resourceMinErr = angular.$$minErr('$resource') | |
angular.module('resources', []) | |
.provider 'Resource', () -> | |
provider = @ | |
provider.prefix = '/api/v1' | |
provider.uriField = 'resource_uri' | |
class ResourceBase |
# config/routes.rb | |
resources :documents do | |
scope module: 'documents' do | |
resources :versions do | |
post :restore, on: :member | |
end | |
resource :lock | |
end | |
end |
require 'date' | |
require 'koala' | |
class BirthdayLiker | |
FACEBOOK_TOKEN = 'your_oauth_key' | |
BIRTHDAY_WORDS = %w(birthday bday birfday birth born) | |
THANKS_OPTIONS = ['Thank you!', 'Thanks!', 'Appreciate it!'] | |
DATE_TIME_FORMAT = '%Y-%m-%d' | |
def initialize(birthdate, opts={}) |
It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time
class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime
steps in:
>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000