Run npm install
then gulp && karma start
to try out the tests.
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
class jQueryCasperWrapper | |
constructor: (@selector) -> | |
wrappedMethods = ['data', 'visible'] # ... plus all the other jQuery functions being wrapped | |
_.each(wrappedMethods, (method) => # lodash/underscore foreach -- just from my own preferences | |
wrapper = (args...) => @RemotejQuery(method, args) | |
@[method] = wrapper | |
) | |
RemotejQuery: (methodName, args) -> |
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
events = require('events') | |
recipe = (id, description, action) -> | |
# `recipe` wraps the Cake `task` command but fires a events through 'recipe'. | |
# | |
# One can listen for an event with `recipe.on('event_name', callback)`, and | |
# call that event with `recipe.emit('event_name', args)`. | |
# | |
# If `action` takes two arguments, the second argument is presumed to be a | |
# `done` callback. The presence of this callback makes the recipe |
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
# This is just a stub variable to keep track of multiple bindings. | |
# One could just have the bindings.date below directly link to | |
# ko.bindingHandlers, but then you would have to update the unit tests. | |
bindings = {} | |
# This gist depends on the inclusion of libraries: | |
# | |
# lodash (or underscore): http://lodash.com | |
# Used for _.isEqual, _.isDate, _.isString, _.defer | |
# |
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
# | |
# Deep pluck | |
# ~~~~~~~~~~ | |
# Pull a deeply nested element out based on an array of arguments | |
# | |
# e.g. array['abc'][0] == deepPluck(array, ['abc', 0]) | |
# | |
deepPluck = (obj, array_or_string, _default=undefined) -> | |
if _.isString(array_or_string) | |
keys = array_or_string.split('.') |
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
import os | |
import sys | |
import logging | |
import unittest | |
from pdb import set_trace | |
from google.appengine.ext import testbed | |
from flask import Flask, session | |
app = Flask('fs') |
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
import Crypto.Random | |
from Crypto.Protocol import KDF | |
from google.appengine.ext import ndb | |
from datetime import datetime | |
class Credentials(ndb.Model): | |
"""Credentials to authenticate a person. | |
""" | |
# --- Class Variables --- | |
# Our pseudo-random stream - used for generating random bits for the |
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
""" | |
From blog post: http://brianmhunt.github.io/articles/ndb-tags/ | |
License: MIT <http://brianmhunt.mit-license.org/> | |
""" | |
from google.appengine.ext import ndb | |
MAX_TAGS_FOR_TAGGABLE = 1000 | |
POPULAR_PAGE_SIZE = 30 |
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
# << Any invalid Javascript character. | |
module.exports.hereiam = -> | |
console.log("0xDEADBEEF") |
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
""" | |
Human UX strings mapping | |
See http://stackoverflow.com/a/27459196 | |
0 1 2 3 4 5 6 7 8 9 A B C D E F Hexadecimal | |
H M N 3 4 P 6 7 R 9 T W C X Y F Replacement | |
Y = U = V | |
C = G |
OlderNewer