Skip to content

Instantly share code, notes, and snippets.

View coolaj86's full-sized avatar
😎
🐹 Go 🦎 Zig 📦 Node 🐧 POSIX 🪟 PowerShell

AJ ONeal coolaj86

😎
🐹 Go 🦎 Zig 📦 Node 🐧 POSIX 🪟 PowerShell
View GitHub Profile
var fb_api_key = 'xxxxxxxxxxxxxxxxxxxxxx';
var fb_channel_path = '/xd_receiver.htm';
var FBApi;
var XFBML;
FB_RequireFeatures(["Api","XFBML"], function(){
FB.XFBML.Host.autoParseDomTree = false;
// Create an ApiClient object, passing app's API key and
// a site relative URL to xd_receiver.htm
FB.Facebook.init(fb_api_key, fb_channel_path, null);
<!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>
Friends
.BirthdayBoysAndGirls({count: 10})
.show({template: my_tempalte})
.parseInterests()
# 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
[{"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
// 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){
// 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
// 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) {
# 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
#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'