Skip to content

Instantly share code, notes, and snippets.

@hcliff
hcliff / gist:2769429
Created May 22, 2012 14:32
Backbone class for retrieving a users facebook friends. Supports pagination and search
# A small class that allows normal backbone interaction with
# the abomination that is the facebook api
# No view included due to the individuality of each solution
# the properties for the model are: uid, name, pic_square
class exports.FacebookFriendsList extends Backbone.Collection
#model: exports.InvitationFacebook
options:
page: 0
class Example.Views.Table extends Backbone.View
template: JST['example/table']
initialize: ->
_.bindAll @, 'addOne', 'addAll'
@collection.on 'add', @addOne
render: ->
@$el.html @template()
class Example.Views.Table extends Backbone.View
template: JST['example/table']
initialize: ->
_.bindAll @, 'addOne', 'addAll'
@collection.on 'add', @addOne
render: ->
@$el.html @template()
class Example.Views.Table extends Backbone.View
template: JST['example/table']
initialize: ->
@collection.on 'add', @addOne
render: ->
@$el.html @template()
@addAll()
@
( ($, window)->
# Store the actual iframe
frame = null
$(window).on 'message',
# Inform the parent if the size of the widget changes
height = 0
setInterval ->
@hcliff
hcliff / sha1.js
Created September 26, 2012 16:38
sha1 javascript
/**
* SHA-1 cryptographic hash constructor.
*
* The properties declared here are discussed in the above algorithm document.
* @constructor
*/
Sha1 = function() {
/**
@hcliff
hcliff / asyncmacros.clj
Created September 27, 2012 15:05
Clojure macro for async callbacks
(ns async.macros
"Macros to avoid callback soup, act as defer/await "
(:use [taoensso.timbre :as timbre :only (trace debug info warn error fatal spy)]))
(defmacro let-async [bindings & body]
<html>
<head>
<title>The Grammy Awards Nominees</title>
<style type='text/css'>
body{
<iframe id="dit-video-embed" width="640" height="360" src="http://static.discoverymedia.com/videos/components/dsc/effaa16e409c5d299de52b5877810aca2ee0aecf/snag-it-player.html?auto=yes" frameborder="0" scrolling="no" allowtransparency="true"></iframe>
<iframe id="dit-video-embed" width="100%" height="100%" src="http://static.discoverymedia.com/videos/components/dsc/effaa16e409c5d299de52b5877810aca2ee0aecf/snag-it-player.html?auto=yes" frameborder="0" scrolling="no" allowtransparency="true"></iframe>