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
[Google](http://google.com "google search engine") | |
// outputs <a href="http://google.com" title="google search engine">Google</a> | |
[Google](http://google.com ":button") | |
// outputs <a href="http://google.com" class="button">Google</a> | |
[Google](http://google.com "google search engine :button") | |
// outputs <a href="http://google.com" class="button" title="google search engine">Google</a> | |
[Google](http://google.com "google search engine :button :external") |
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
mods-enabled/alias.load | |
mods-enabled/authz_owner.load | |
mods-enabled/env.load | |
mods-enabled/negotiation.load | |
mods-enabled/auth_basic.load | |
mods-enabled/autoindex.load | |
mods-enabled/headers.load | |
mods-enabled/authz_default.load | |
mods-enabled/deflate.load | |
mods-enabled/mime.load |
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 | |
/** Dynamic method injection to php **/ | |
class Dog { | |
static $_methods; | |
function __call($method, $args) { | |
if (isset(self::$_methods[$method])) { | |
$method = self::$_methods[$method] | |
} |
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 Transaction < ActiveRecord::Base | |
belongs_to :transactable, :polymorphic => true | |
end |
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
function findClosestLine($line) { | |
$Line->find('first', array( | |
'conditions' => array('line <='=>5.1), | |
'order' => 'line desc' | |
)); | |
} |
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
Sign, all my math are forgotten, anyway, | |
10 new customer a day, billed 40bucks monthly over a year = near one million annually, but | |
same condition but 5 customer a day = half million annually | |
Here is the millionaire calculation formula | |
40 * 30 * 12 / 2 * (1 + 12) * x = $$$ | |
given x is the number of new customer yer day.. |
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
{{ 'post_view' | zend_url postid: post.id }} | |
// url for post_view route | |
{{ 'Martel' | links_to_route 'user' username: 'martel' }} | |
// links_to_route helper filter | |
// outputs <a href="<?= $this->url(array('username' => 'martel'), 'user') ?>">Martel</a> |
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
// Map function | |
function(doc) { | |
// Format date to yyyy mm dd | |
var date = doc.created_at.replace(/T|-/g, ' ').replace('+', ' +'); | |
// return advertiser, date | |
emit(doc.accounts.advertiser, date.substring(0,10)) | |
} | |
// Reduce function |
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
rake db:drop | |
rake db:migrate | |
rake seed:load |
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 Account < ActiveRecord::Base | |
belongs_to :owner, :class_name => 'User', :foreign_key => 'user_id' | |
has_many :users | |
has_many :transactions | |
has_many :websites | |
has_many :campaigns | |
def display_name | |
company || full_name || '' | |
end |