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
window.onerror = function(message, url, line_num) { | |
// Standard error information | |
var error = '\n JS Error: ' + message + ' from ' + url + ':' + line_num; | |
error += '\n URL: ' + document.URL; | |
// User agent info, using https://github.com/caseyohara/user-agent | |
var user_agent = new UserAgent(); | |
error += '\n Browser: ' + user_agent.browser_name + ' ' + user_agent.browser_version + ' | OS: ' + user_agent.os + ' | Platform: ' + user_agent.platform; |
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
/** | |
* A function that takes a template and grammatical options ('gender', 'person', 'name') and returns the computed string. | |
* See below for examples. | |
* | |
* See wikipedia for more on grammar: | |
* http://en.wikipedia.org/wiki/English_personal_pronouns | |
* http://en.wikipedia.org/wiki/Grammatical_conjugation | |
*/ | |
function personalize(template, options) { | |
var GENDERS = ['neutral', 'female', 'male']; |
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
# Makefile for JS/CSS: | |
# Uses Closure for JS compiling, YUI for CSS compiling, and JsHint for code quality checking | |
MAKEFLAGS = --no-print-directory --always-make | |
MAKE = make $(MAKEFLAGS) | |
BUILDDIR = ./.build | |
CLOSUREURL = http://closure-compiler.googlecode.com/files/compiler-latest.zip | |
CLOSUREDIR = $(BUILDDIR)/closure |
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
@login_required | |
def handle_logout(): | |
import facebook | |
if g.user.facebook_id: | |
base_domain = util.get_base_domain() | |
default_fb_data = FB_DATA['appspot.com'] | |
fb_app_id = FB_DATA.get(base_domain, default_fb_data).get('appid') | |
fb_app_secret = FB_DATA.get(base_domain, default_fb_data).get('appsecret') | |
cookie = facebook.get_user_from_cookie(request.cookies, fb_app_id, fb_app_secret) |
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
<!doctype html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width" /> | |
<title>PhoneGap App</title> | |
<script> | |
var timedEvents = []; | |
function timeEvent(name) { | |
timedEvents.push({'name': name || 'unnamed', time: Date.now()}); | |
} |
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
function sendData(url, data, onSuccess, onError) { | |
$.ajax({ | |
url: url, | |
type: 'POST', | |
data: data, | |
dataType: 'json', | |
xhrFields: { | |
withCredentials: true | |
}, |
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
['width', 'height'].forEach(function(dimension) { | |
var offset, Dimension = dimension.replace(/./, function(m) { return m[0].toUpperCase() }); | |
$.fn['outer' + Dimension] = function(margin) { | |
var elem = this; | |
if (elem) { | |
var size = elem[dimension](); | |
var sides = {'width': ['left', 'right'], 'height': ['top', 'bottom']}; | |
sides[dimension].forEach(function(side) { | |
size += parseInt(elem.css('padding-' + side), 10); |
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
(function($) { | |
// Used by dateinput | |
$.expr = {':': {}}; | |
// Used by bootstrap | |
$.support = {}; | |
// Used by dateinput | |
$.fn.clone = function(){ | |
var ret = $(); |
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
/** | |
* @license | |
* jQuery Tools @VERSION Dateinput - <input type="date" /> for humans | |
* | |
* NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. | |
* | |
* http://flowplayer.org/tools/form/dateinput/ | |
* | |
* Since: Mar 2010 | |
* Date: @DATE |