This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Table Of Contents | |
Acknowledgments.............................................................................i | |
An Introduction to The CodeIgniter Handbook ................................................ii | |
An Introduction to Volume One...............................................................iii | |
Who should read this book? .................................................................iv | |
Part 1 - Models | |
Fat Model, Skinny Controller........................................................... 3 | |
Standard Model Conventions............................................................. 4 | |
Observers ............................................................................. 16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Forum < ActiveRecord::Base | |
has_many :topics | |
belongs_to :category, :denormalize => [ :name ] | |
end | |
class Topic < ActiveRecord::Base | |
belongs_to :forum | |
has_many :messages | |
denormalizes :messages, :as => :messages_count { messages.length } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.progress { height: 15px; max-width: 300px; background: #555; position: relative; -moz-border-radius: 25px; -webkit-border-radius: 25px; border-radius: 25px; -webkit-box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3); -moz-box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3); box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3); } | |
.progress > span { | |
display: block; | |
height: 100%; | |
-webkit-border-top-right-radius: 8px; | |
-webkit-border-bottom-right-radius: 8px; | |
-moz-border-radius-topright: 8px; | |
-moz-border-radius-bottomright: 8px; | |
border-top-right-radius: 8px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"aed": { | |
"priority": 100, | |
"iso_code": "AED", | |
"name": "United Arab Emirates Dirham", | |
"symbol": "د.إ", | |
"subunit": "Fils", | |
"subunit_to_unit": 100, | |
"symbol_first": true, | |
"html_entity": "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sp = getSpotifyApi(1), | |
models = sp.require('sp://import/scripts/api/models'), | |
player = models.player; | |
exports.init = function(){ | |
player.observe(models.EVENT.CHANGE, function(e){ | |
if (e.data.curtrack == true) { | |
if (player.track.album.artist.name == 'Michael Bublé') { | |
player.play('spotify:track:5xMAMaVbW3tkjXTmSUBPTd'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Customer extends MY_Model { | |
protected $relations = array( | |
'addresses' => array( | |
'join_on' => 'addressable_id', | |
'where' => array('addresses.addressable_type' => 'customers') | |
) | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Comedian | |
by Jamie Rumbelow | |
----------------- | |
Sometimes I, I despise being me, being unhappy | |
Because no, nobody ever takes me seriously | |
Still I try to be wise and laugh when others laugh at me | |
Look around, see what you’ve done, I’m Cassius, I’ve killed everyone, | |
Every day in your needled way, can you stop? Are you done? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------- | |
// NO <?php TAG! | |
// ---------------------- | |
// ---------------------- | |
// SIGNIFICANT WHITESPACE ELIMINATES THE NEED | |
// FOR CURLY BRACES (YAY) | |
// ---------------------- | |
class Sessions extends MY_Controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/Sites | |
export EDITOR="mate " | |
PS1="\[\033[1;44m\]\n\u:\w \$(vcprompt)\n\[\033[0m\] " | |
export RAILS_ENV="development" | |
export PATH="/usr/local/Cellar/php/5.3.6/bin:/Users/jamierumbelow/local/node/bin:/Users/jamierumbelow/pear/bin/:/usr/local/apache2/bin/:$PATH" | |
if [ -f `brew --prefix`/etc/bash_completion ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sweetie, you're going to forget me | |
by Jamie Rumbelow | |
============================== | |
Capo on 3, but the chords are NOT relative | |
Abmaj7 (played like an open F), Ebmaj7 | |
Sweetie, that day that you left me, | |
I knew you were gonna forget me | |
Sweetie, know that you upset me, |