Download the files, run them on a local server (python -m SimpleHTTPServer
works fine), and open up index.html
.
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
<form action="your-action.lang" method="POST"> | |
<script | |
src="https://my.tok3n.com/v1/embed.js" class="your-class" | |
data-publicKey="dOcPsnXndcRw3QdIosnE0j" | |
data-userKey="Ngfl6Gn2q15g8mR28vi2no" | |
data-theme="default" | |
data-action-name="Login" | |
data-app-name="Demo Site"> | |
</script> | |
<input type="submit" /> |
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
var prototypeChain = function( o ) { | |
prototypes = []; | |
while ( o = Object.getPrototypeOf( o ) ) { | |
prototypes.push( o ) | |
} | |
return prototypes; | |
} |
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
# uses dummy elements to listen for/dispatch events | |
class ControlCollectionA extends Array | |
constructor : ( arr ) -> | |
this.push( item ) for item in arr | |
this.el = document.createElement "dummy" | |
on : ( eventType, handler ) -> | |
thisEl = this.el | |
thisEl.addEventListener eventType, handler.bind( this ), false |
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
compose = do -> | |
each = ( obj, itr ) -> | |
list = if Array.isArray( obj ) then obj.map ( e, i ) -> i else Object.keys( obj ) | |
i = 0 | |
while i < list.length | |
itr( obj[ list[i] ], list[ i ], obj ) | |
i += 1 | |
obj | |
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
var getPrototypeChainOf = function( obj ) { | |
var chain = []; | |
if ( isFunction(obj) ) { | |
obj = obj.prototype; | |
} else { | |
obj = obj.constructor.prototype; | |
} | |
do { |
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
// adapted from: | |
// http://javascriptweblog.wordpress.com/2010/04/05/curry-cooking-up-tastier-functions/ | |
// http://javascriptweblog.wordpress.com/2010/04/14/compose-functions-as-building-blocks/ | |
function curry( fn ) { | |
if ( arguments.length < 2 ) { | |
return fn; | |
} | |
var args = [].slice.call( arguments, 1 ); | |
return function() { |
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
var compose = function compose(f) { | |
var queue = f ? [f] : []; | |
var fn = function fn(g) { | |
if (arguments.length) { | |
queue.push(g); | |
return fn; | |
} | |
return function() { | |
var args = Array.prototype.slice.call(arguments); | |
queue.forEach(function(func) { |
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
var first = (function() { | |
var chainNames = ["then", "andThen", "next"]; | |
var endChainNames = ["finally", "andFinally", "last"]; | |
var chain = function(fn) { | |
var f1 = function(g) { | |
var func = function() {return g.call(this, fn.apply(this, arguments));}; | |
chain(func); | |
return func; | |
}; | |
var f2 = function(g) { |
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
pairs = ( obj ) -> | |
arr = [] | |
for own key, val of obj when key isnt "id" | |
arr.push "#{ key }=#{ val}" | |
arr.join "," | |
makeORMClass = ( table ) -> | |
# CoffeeScript syntactic sugar for class creation. | |
class Model |