Skip to content

Instantly share code, notes, and snippets.

View speedmax's full-sized avatar

Taylor luk speedmax

View GitHub Profile
def index
@az_idols = ("a"..."z").reduce({}) do |result, letter|
res = Idol.find :all, :conditions=>["name LIKE ?", "#{letter}%"]
result[letter] = res unless res.empty?
result
end.sort
end
CREATE TABLE adrev_ad_types (
id int(11) NOT NULL auto_increment,
name varchar(64) NOT NULL default '',
template text,
PRIMARY KEY (id), KEY name (name))
CREATE TABLE adrev_ads (
id int(11) NOT NULL auto_increment,
userid int(11) NOT NULL default '0',
specials:
title: Action all the time
country: [au]
url: http://centrebet.com/?GoSports
from: now
to: 02-09-2009
content: >
If the world of Sports and Racing has nothing to offer you, then
check out Centrebet’s Special & Entertainment Odds.
/*
Standarized Data API design in JSON object
we should also learn from google data API recommended attributes for
Events & activities
-http://base.google.com/base/api/itemTypeDocs?verticalName=events%20and%20activities&verticalLocale=en_US
Universal attributes
- http://base.google.com/base/api/universalAttributes?verticalLocale=en_US
<?php
function openbet($class, $attrs = array()) {
$class = "Openbet_".ucwords($class);
return new $class;
}
class Openbet_Object {
function __construct($attrs = array()) {
# set object property
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
rake db:drop
rake db:migrate
rake seed:load
// 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
{{ '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>
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..