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
import random | |
from google.appengine.ext import ndb | |
class RandomIndexedModel(ndb.Model): | |
"""Abstracts how we do randomness in the other models.""" | |
random_index = ndb.FloatProperty('ri') | |
@classmethod | |
def random(cls, count=1, exclude=None, ancestor=None, filters=None): |
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
/** | |
* Generates number of random geolocation points given a center and a radius. | |
* @param {Object} center A JS object with lat and lng attributes. | |
* @param {number} radius Radius in meters. | |
* @param {number} count Number of points to generate. | |
* @return {array} Array of Objects with lat and lng attributes. | |
*/ | |
function generateRandomPoints(center, radius, count) { | |
var points = []; | |
for (var i=0; i<count; i++) { |
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 simple GeoPoint object to generate random points nearby.""" | |
import math | |
import random | |
class GeoPoint(object): | |
"""Represents a geolocation point with latitude and longitude.""" |
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 app = angular.module('app'); | |
app.directive('mkShortcut', function($document) { | |
// Ref: http://goo.gl/7XDys | |
function fireEvent(element, event) { | |
if (document.createEvent) { | |
// dispatch for firefox + others | |
var evt = document.createEvent("HTMLEvents"); | |
evt.initEvent(event, true, true ); // event type,bubbling,cancelable |
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
<link rel="import" href="../components/polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
#core_scaffold { | |
position: absolute; | |
top: 0px; | |
right: 0px; |
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
<link rel="import" href="../components/polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
#core_drawer_panel { | |
position: absolute; | |
top: 420px; | |
right: 0px; |
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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html"> | |
<link rel="import" href="../paper-tabs/paper-tabs.html"> | |
<link rel="import" href="../paper-tabs/paper-tab.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> |
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 element = document.getElementById('editor'); | |
var editor = new carbon.Editor(element, { | |
rtl: true, | |
modules: [carbon.EmbeddedComponent] | |
}); | |
editor.install(carbon.EmbeddingExtension, { | |
embedProviders: { | |
embedly: new carbon.EmbedlyProvider({ | |
apiKey: EMBEDLY_API_KEY |
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 element = document.getElementById('editor'); | |
var editor = new carbon.Editor(element, { | |
rtl: true, | |
modules: [carbon.EmbeddedComponent] | |
}); | |
editor.install(carbon.EmbeddingExtension, { | |
embedProviders: { | |
embedly: new carbon.EmbedlyProvider({ | |
apiKey: EMBEDLY_API_KEY |
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
'use strict'; | |
importScripts("workers/sw-toolbox-workers.js"); | |
var PrecacheConfig = [ | |
["404.html", "85f3907148cdb68254687c3de7f89a25"], | |
["bower_components/angular-file-upload/dist/angular-file-upload-shim.min.js", "026ef609992ad0f8d1b02dae399a764b"], | |
["favicon.ico", "b2eb3d352ea4e8f74b160b46ccc881b9"], | |
["https://ajax.googleapis.com/ajax/libs/angularjs/1.3.17/angular.min.js", "cd13a2e1aad01b347ad15d5e201f39ee"], | |
["https://fonts.googleapis.com/earlyaccess/droidarabicnaskh.css", "0d94281129940b9c1a522545882c8293"], | |
["https://fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Bold.ttf", "aedd83523a65f2c0dc4e2bad69b94534"], | |
["https://fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Bold.woff", "78aa34ad512567cf0b5e7fc611ff3099"], |
OlderNewer