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
#!/usr/bin/env python | |
# | |
# Copyright 2007 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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 ( | |
"appengine/blobstore" | |
aeimage "appengine/image" | |
) | |
func servingURL(c appengine.Context) error { | |
blobKey, err := blobstore.BlobKeyForFile(c, "/gs/bucketname/file") | |
if err != nil { | |
return err | |
} |
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
// npm install agentkeepalive batch-stream csv-parse stream-transform | |
var HttpsAgent = require('agentkeepalive').HttpsAgent; | |
var Algolia = require('algolia-search'); | |
var stream = require( 'stream' ); | |
var parse = require('csv-parse'); | |
var fs = require('fs') | |
var transform = require('stream-transform'); | |
var Batch = require( 'batch-stream' ); |
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
Bacon = require('baconjs') | |
Imm = require('immutable') | |
React = require('react') | |
window.Actions = | |
changeFirstName: new Bacon.Bus() | |
changeLastName: new Bacon.Bus() | |
changeCountry: new Bacon.Bus() | |
addCountryBird: new Bacon.Bus() | |
addFriend: new Bacon.Bus() |
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
#!/usr/bin/env python | |
# | |
# Replacement `MtimeFileWatcher` for App Engine SDK's dev_appserver.py, | |
# designed for OS X. Improves upon existing file watcher (under OS X) in | |
# numerous ways: | |
# | |
# - Uses FSEvents API to watch for changes instead of polling. This saves a | |
# dramatic amount of CPU, especially in projects with several modules. | |
# - Tries to be smarter about which modules reload when files change, only | |
# modified module should reload. |
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
# Whitelist collections | |
ALLOW_COLLECTIONS = { | |
'accounts': true | |
'users': true | |
} | |
module.exports = (shareClient) -> | |
# Hold on to session object for later use. The HTTP req object is only | |
# available in the connect event | |
shareClient.use 'connect', (shareRequest, next) -> |
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
{{define "body"}} | |
This is the start page. | |
<br><br> | |
Check out <a href="/user/5">user 5</a> or <a href="/user/7">user 7</a>. | |
{{end}} | |
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 racerAccess = require('racer-access'); | |
derby.use(racerAccess); | |
var store = derby.createStore(); | |
// This is current racer-access api | |
store.allow('change', 'users', function(docName, changeTo, snapshotData, connectSession) { | |
return; | |
}); | |
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
ALLOWED_COLLECTIONS = [ | |
'auths' # Private user data | |
] | |
store.allow 'create', 'auths', (docId, newDoc, session) -> | |
console.log '[Auths] CREATE' | |
undefined | |
store.allow 'all', 'auths.*', (docId, relPath, opData, docBeingUpdated, session) -> | |
console.log '[Auths] CHANGE' |
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
#make a hook | |
store.hook 'change', 'collection.*.foo', (docId, value, op, session, backend) -> | |
model = store.createModel() | |
#logic | |
#setup the hook method | |
store.hook = (method, pattern, fn) -> | |
store.shareClient.use 'after submit', (shareRequest, next) -> | |
{opData} = shareRequest |
NewerOlder