Skip to content

Instantly share code, notes, and snippets.

View ElliotChong's full-sized avatar
✌️

Elliot Chong ElliotChong

✌️
View GitHub Profile
@ElliotChong
ElliotChong / facebookInclude.coffee
Created October 2, 2012 23:11
Include Facebook within a webpage via JS - No DOM elements necessary
window.fbAsyncInit = ->
FB.init
appId: '0123456789' # App ID
channelUrl: "//#{ window.location.hostname }/channel.html" # Channel File
status: true # Check login status
cookie: true # Enable cookies to allow the server to access the session
xfbml: true # parse XFBML
frictionlessRequests: true # Enable frictionless Request dialogs
# Application-specific initialization code goes here
@ElliotChong
ElliotChong / addInheritance.js
Created September 4, 2012 18:13
Add inheritance to JavaScript
(function ()
{
if (!Function.prototype.inherit)
{
Function.prototype.inherit = function (p_parent)
{
if (p_parent.constructor == Function)
{
// Normal Inheritance
this.prototype = new p_parent();
@ElliotChong
ElliotChong / proxy.js
Created September 4, 2012 17:57
JavaScript implementation of a Proxy class.
/**
* JavaScript implementation of a Proxy class.
**/
function Proxy(p_target)
{
var self = this;
self.target = p_target;
// Access target's properties
self.get = function (p_property)