Skip to content

Instantly share code, notes, and snippets.

View speedmax's full-sized avatar

Taylor luk speedmax

View GitHub Profile
cd ~/Library/Application\ Support/TextMate
git clone git://github.com/bmabey/cucumber-tmbundle.git
git clone git://github.com/dchelimsky/rspec-tmbundle.git
Ad Valorem (USA) 2002
Alamosa (NZ) 2004
Align (AUS) 1996
All Bar One (AUS) 2001
# Monkey patch to fix bug in rails 2.3 + ruby1.9.1 integration tests (rspec, cucumber, webrat)
# Put it in your support folder and require it in your env.rb
# features/support/ruby19_integration_path.rb
#
module ActionController
module Integration
class Session
private
Sports Event
{
id:
account_id:
channel_id:
sport: 'Football Matches'
competition: 'UEFA U21 Championship Matches'
title: 'The Ashes 2009'
url: 'http://some bookie.com'
<select id="country">
<optoin>Australia</option>
<option>China</option>
</select>
<select id="city">
</select>
@speedmax
speedmax / patch_secure_compare.rb
Created September 7, 2009 03:06
money patch rails to fix bug #3144
module ActiveSupport
class MessageVerifier
private
# constant-time comparison algorithm to prevent timing attacks
def secure_compare(a, b)
if a.respond_to?(:bytes)
a.bytes.to_a == b.bytes.to_a
else
a.to_a == b.to_a
end
@speedmax
speedmax / simple ssl_requirement in cakePHP.php
Created August 21, 2009 06:47
simple ssl_requirement in cakePHP
<?
class AppController extends Controller {
var $sslRequired = array('login', 'logout');
var $sslAllowed = array('index');
var $beforeFilter = array('ensureProperProtocol');
private function sslRequired() {
return in_array($this->action, $this->sslRequired);
}
./configure \
--prefix=/usr/local/php5.3 \
--mandir=/usr/local/share/man \
--infodir=/usr/local/share/info \
--with-config-file-path=/usr/local/etc \
--enable-calendar \
--with-iconv=/opt/local \
--enable-exif \
--enable-ftp \
--enable-wddx \
@speedmax
speedmax / photogallery_controller.rb
Created August 14, 2009 10:46
File cache your high traffic actions
class PhotogalleriesController < ApplicationController
caches_action :list, :show
end
@speedmax
speedmax / sync.rake
Created August 14, 2009 07:11
app:sync - local and production synchronization
# app:sync
# Local and production synchronization
# - require yaml_db plugin
namespace :app
namespace :sync do
task :all => [:files, :db]
task :files do
`rsync -azv user@host:'/apps/myawesomeapp/shared/files/' #{Rails.root + 'files'}`