Skip to content

Instantly share code, notes, and snippets.

View speedmax's full-sized avatar

Taylor luk speedmax

View GitHub Profile
<?
class Person {
protect $data = array(
'name' => 'The king',
'age' => 19
);
function __get($attr) {
if (isset($this->data[$attr]))
return $this->data[$attr];
module Webrat #:nodoc:
class MechanizeSession < Session #:nodoc:
def mechanize
@mechanize ||= WWW::Mechanize.new
end
end
end
<?php
require_once 'Benchmark/Timer.php';
class Benchmark {
var $iteration = 100;
function setup() {
}
final static function report() {
6-Feb-09
dotDefender Blocked Your Request
Please contact the site administrator, and provide the following Reference ID:
2E0B-BC5A-268A-02B1
class Idol < ActiveRecord::Base
has_many :banners
has_many :pidols
has_and_belongs_to_many :filedatas
has_and_belongs_to_many :members
has_and_belongs_to_many :photogalleries
has_and_belongs_to_many :moviegalleries
def to_param
"#{id}-#{name.slugify}"
@speedmax
speedmax / 1. template.html
Created February 11, 2009 07:47
h2o code generation concept, 4 and 5 are executable code
<h1>{{ person.name }}</h1>
{% block content %}
<small>block:{{ block.name }}, level: {{ block.depth }} ?></small>
(i am {{ block.age }} years old)
{% endblock %}
<ul>
{% for hobby in person.hobbies %}
<li>{{ hobby|capitalize }}</li>
{% endfor %}
</ul>
@speedmax
speedmax / 1. argument parsing example
Created February 6, 2009 14:31
H2o hacking guide
H2o hacking guide
argument parsing.
=====================
* variable name turns to ":variable" which uses ruby symbol style string to indicate if its a variable and to speed up context lookup
* arguments are seperated by comma
* anything looks like named argument(name: "peter", age: 18) will parse into a option style array
H2o_Parser::parseArguments("variable")
<?php
/**
* To implment tagging behavior to be able to plug into any data model in the system
*
* Requirements
* You are required to create "tags" table to hold all tag entries
* You are required to create a "[tableName]_tags" table for each object you
* want to tag. for example, to implement tags for pages u need this table
* pages_tags (page_id : int, tag_id)
*
- <var class="parent parent dl casino"/>
- ![Centrebet casino][1]
- param1
![Centrebet Games][2]
param 2
param 3
- **The Largest European Poker Network**
- **Guaranteed US$15 Million won Every Month**
- **Trips to the Greatest Land Based Events**
- **Free $*600 to Get the Action Started**
### Join Today for our 100% MATCH DEPOSIT up to $600 ###
*Minimum deposit required and wagering restrictions apply. For more information read our [Terms and Conditions.][1]