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
LDFLAGS += -flat_namespace -undefined warning -fPIC |
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 | |
class Mysql { | |
static public function query(){ | |
$args = func_get_args(); | |
return mysql_query(call_user_func_array(array("self", "queryf"), $args)); | |
} | |
static public function queryf(){ |
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
source 'http://rubygems.org' | |
gem "sinatra" |
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
# db/migrate/20101004063749_create_photos.rb | |
class CreatePhotos < ActiveRecord::Migration | |
def self.up | |
create_table :photos do |t| | |
t.string :name, :null => false | |
t.binary :data, :null => false | |
t.string :filename | |
t.string :mime_type | |
t.timestamps |
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
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] |
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
# your custom search | |
@search = Product.search(params[:search]) | |
# searchlogic default | |
@search = Product.searchlogic(params[:search]) |
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
A contents <<< | |
send this to a | |
this goes to a | |
a, I forgot to add this | |
<<< | |
B contents <<< | |
this goes to b | |
b, please | |
<<< |
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
cd /data/MyApp/current && /usr/bin/rake some:task |
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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
response = Net::HTTP.post_form( | |
URI.parse("http://closure-compiler.appspot.com/compile"), | |
{ | |
:js_code => STDIN.read, |
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
require "benchmark" | |
ITERATIONS = (ARGV[0] || 10000).to_i | |
def pick(set) | |
set[rand(set.size)] | |
end | |
def trial(method) |