Skip to content

Instantly share code, notes, and snippets.

View speedmax's full-sized avatar

Taylor luk speedmax

View GitHub Profile
require 'net/dns/resolver'
# Custom Domain
#
# Require net-dns gem
#
# A Rack middleware to to resolve the custom domain to original subdomain
# for your multi telent application.
#
# It's all transperant to your application, it performs cname lookup and
a.button {
background:transparent url(http://www.siterest.com/images/button_r.png) no-repeat scroll right top;
color:#000000;
display:block;
float:left;
font-family:Arial,Helvetica,sans-serif;
font-size:12px;
font-weight:bold;
height:32px;
margin:0 6px 0 0 !important;
Host: assets.siterest.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1
Accept: text/css,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.taylorluk.com/
If-Modified-Since: Wed, 03 Jun 2009 16:12:45 GMT
<?php
//--------------------------------------- Preperation
require('includes/h2o.php');
require('includes/config.php');
require('includes/functions.php');
db_connect($dbhost, $dbuser, $dbpass, $dbname);
// Start: Get settings
<script type="text/javascript">
var iframe = document.createElement('iframe');
iframe.style.border = 0;
iframe.style.backgroundColor = '#fff';
iframe.style.width = '160px';
iframe.style.height = '600px';
var container = document.getElementById('oddsense') || document.body;
container.appendChild(iframe);
class Question < AbstractContent
acts_as_taggable
serialize :body
def answers
self.body_source
end
def answers_html
self.answers.map do |answer|
<?php
class Object {
function send($method) {
$args = func_get_args();
$method = array_shift($args);
# Instace method call
if (isset($this)) {
class Resume < ActiveRecord::Base
# Attributes
# ================
# Resume(
# :person => Person, :position=> STRING, :summery => TEXT, :content => TEXT,
# :experiences => Experience, :qualifications => Qualification
# )
belongs_to :person
has_many :experiences
has_many :qualification
@speedmax
speedmax / 1. Utilizing h2o can really DRY more the code.html
Created June 2, 2009 13:37
H2o filters provide a easy way to extend the template system
{{ "Add user"|links_to '/user/add', title: "Create a new user" }}
{{ "Add Discount|links_to '/discount/add', class: "button", style: "float:right" }}
instead of
<a href="{{site_dir}}user/add">Add User</a><br>
<a href="{{site_dir}}user/listAll">List Users</a><br><br>
class Question < AbstractContent
acts_as_taggable
serialize :body
def answers
self.body_source
end
def answers_html