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 | |
function openbet($class, $attrs = array()) { | |
$class = "Openbet_".ucwords($class); | |
return new $class; | |
} | |
class Openbet_Object { | |
function __construct($attrs = array()) { | |
# set object property |
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
/* | |
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 |
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
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. | |
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
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', |
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
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 |
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
>> Product.find :all, :conditions => ["title LIKE ?", "c%"] | |
=> [#<Product id: 339768653, title: "Canon EOS 40D 10.1MP Digital SLR Camera", description: "This is an H1\r\n=============\r\n\r\n\r\n\r\nBuilding on the...", price: 1199.0, created_at: "2008-06-05 23:50:39", updated_at: "2008-09-05 12:31:06", quantity: 70, brand_id: 528229938, product_type_id: 985430838, price_min: #<BigDecimal:2483b98,'0.1199E4',4(8)>, price_max: #<BigDecimal:2483b5c,'0.1899E4',4(8)>, handle: "canon-eos-40d-101mp-digital-slr-camera", description_html: "<h1>This is an H1</h1>\n\n<p>Building on the success ...", filter: "markdown_filter">, #<Product id: 1024741415, title: "Casio Exilim EX-S10", description: "Casio has its finger in more pies than Billy Bunter...", price: 249.0, created_at: "2008-06-05 23:50:39", updated_at: "2008-06-05 23:50:39", quantity: 50, brand_id: 528229938, product_type_id: 425291712, price_min: #<BigDecimal:2483634,'0.249E3',4(8)>, price_max: #<BigDecimal:24835f8,'0.249E3',4(8)>, handle: "casio-exilim-ex-s1 |
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
<div class="good-evans span-8 last" style="float:right"> | |
{{ '/img/goodevans.png'|image_tag }} | |
<ul> | |
{% for article in site.articles_tagged.good-evans %} | |
<li>{{ article.title | links_to article.url }}</li> | |
{% endfor %} | |
</ul> | |
</div> | |
<div class="latest-buzz span-10"> |
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 | |
h2o::addTag('load_sports_events'); | |
class Load_sports_events_Tag extends H2o_Node { | |
function render($context, $stream) { | |
$cache = h2o_cache($context->options); | |
$cache_key = 'digg_xml_feed'; | |
# try cached | |
if (! ($feed = $cache->read($cache_key))) { | |
$feed = file_get_contents('http://feeds.digg.com/digg/popular.rss'); |
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
// Option 1, flat tags | |
$page['tags'] = array('soccer', 'cricket betting', 'football'); | |
// get keyword | |
<meta type="keyword" content="{{ page.tags|join }}"/> | |
// get list of tag links | |
{% for tag in page.tags %} | |
<a href="{{ tag|tag_url }} ">{{ tag }}</a> | |
{% endfor %} |
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 | |
/** | |
* Min | |
* ======================== | |
* A lightweight framework to provide convient wrappers for PHP to improve | |
* grammers when programming | |
* | |
* @author Taylor luk | |
*/ | |