This file contains 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" > | |
<head> | |
<script src="javascripts/json2.js" type="text/javascript"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> | |
<script src="javascripts/underscore-min.js" type="text/javascript"></script> | |
<script src="javascripts/pure.js" type="text/javascript"></script> | |
<link rel=stylesheet href="stylesheets/main.css" type="text/css" media=screen> | |
<style> |
This file contains 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
Friends | |
.BirthdayBoysAndGirls({count: 10}) | |
.show({template: my_tempalte}) | |
.parseInterests() |
This file contains 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
# lib/ez_amz.rb | |
module EZAmz | |
require 'rubygems' | |
require 'amazon/aws' | |
require 'amazon/aws/search' | |
require 'active_support' | |
include Amazon::AWS | |
include Amazon::AWS::Search |
This file contains 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
[{"location"=>#<Amazon::AWS::AWSObject::Location:0xb74a18cc @user_defined_location=[#<Amazon::AWS::AWSObject::UserDefinedLocation:0xb74a1750 value=" USA">]>, "wish_list_id"=>#<Amazon::AWS::AWSObject::WishListId:0xb74a19e4 value="19ZUEMHN4UIFK">, "customer_reviews"=>#<Amazon::AWS::AWSObject::CustomerReviews:0xb74a15d4 @total_review_pages=[#<Amazon::AWS::AWSObject::TotalReviewPages:0xb74a1214 value="1">], @review=[#<Amazon::AWS::AWSObject::Review:0xb74a1070 @asin=[#<Amazon::AWS::AWSObject::ASIN:0xb74a0ecc value="0782143121">], @content=[#<Amazon::AWS::AWSObject::Content:0xb749fd74 value="When...">], @total_votes=[#<Amazon::AWS::AWSObject::TotalVotes:0xb74a0260 value="6">], @reviewer=[#<Amazon::AWS::AWSObject::Reviewer:0xb74a09cc @customer_id=[#<Amazon::AWS::AWSObject::CustomerId:0xb74a0850 value="A3CO3V2K8G92XD">], @name=[#<Amazon::AWS::AWSObject::Name:0xb74a06ac value="Anonymous">], @nickname=[#<Amazon::AWS::AWSObject::Nickname:0xb74a0508 value="~ CoolAJ86">], @location=[#<Amazon::AWS::AWSObject::Location:0xb7 |
This file contains 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
// fake jQuery and jGrowl | |
window.$ = window.$ || {}; | |
$.jGrowl = $.jGrowl || function(data,params){ | |
alert('for non-obtrusive alerts, get jGrowl...\n' + JSON.stringify(data)); | |
}; | |
// This creates a "closure" for all variables inside. | |
(function(window){ | |
This file contains 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
// Protect the global namespace | |
(function(){ | |
// Create a static scope | |
var a = 1, | |
b = 2, | |
c = 3; | |
d = 4; | |
// Create a fun little object to toy with | |
var Obj = new function(){ | |
var b = 5; // this private 'b' takes precedence its namesake in the closure |
This file contains 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
// Douglas Crockford's promise.js | |
// http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-3 | |
function make_promise() { var status = 'unresolved', | |
outcome, | |
waiting = [], | |
dreading = []; | |
function vouch(deed, func) { | |
switch (status) { |
This file contains 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
# Adding CORS / XHR2 / XDR support to Rails 2.3.x | |
# In Ubuntu the original file is found at | |
#/var/lib/gems/1.8/gems/actionpack-2.3.3/lib/action_controller/resources.rb | |
# The patch should be placed in your rails project in | |
#./config/initializers/resources.rb | |
module ActionController | |
module Resources |
This file contains 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
#app/controllers/guest_sessions_controller.rb: | |
# Show HTTP OPTIONS for XHR2 / CORS requests | |
def options | |
render :nothing => true, :status => 204 | |
response.headers['Access-Control-Allow-Origin'] = '*' | |
response.headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' | |
response.headers['Access-Control-Allow-Credentials'] = 'true' | |
response.headers['Access-Control-Max-Age'] = '86400' # 24 hours | |
response.headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept' |
OlderNewer