Skip to content

Instantly share code, notes, and snippets.

[07/09 18:36:50 GMT+0300] at EventEmitter._tickCallback (node.js:190:38)
[07/09 18:36:50 GMT+0300] at Array.0 (net.js:756:28)
[07/09 18:36:50 GMT+0300] at errnoException (net.js:670:11)
[07/09 18:36:50 GMT+0300] Error: listen EACCES
[07/09 18:36:50 GMT+0300] ^
@MeLight
MeLight / gist:3299564
Created August 8, 2012 22:57
Do I need autosub here?
//Client
Meteor.subscribe("requests", Session.get('player_id'), function(){
var call = Calls.findOne();
Meteor.call("answerCall", call._id);
});
//Server
Meteor.publish("requests", function(player_id) {
if(player_id == undefined) return null;
return Calls.find({toUser: player_id, status: "request"});
@MeLight
MeLight / gist:3307484
Created August 9, 2012 19:50
Is this supposed to publish?
//Server
Meteor.publish("requests", function(player_id) {
var self = this;
var uuid = Meteor.uuid();
var handle = Calls.find({toUser: player_id, status: "request"}).observe({
added : function(doc) {
self.set("requests", uuid, doc);
self.flush();
}
});
@MeLight
MeLight / gist:3315278
Created August 10, 2012 16:09
Why don't I get notifications on the client?
//Client
Meteor.autosubscribe(function() {
console.log("Subbed to request");
Meteor.subscribe("requests", Session.get('player_id'), function(){
var call = Requests.findOne();
console.log("in request (call: " +call+")");
Meteor.call("answerCall", call._id);
});
});
hello world this, and that
application: woven-environs-93111
version: dev
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon.ico
static_files: favicon.ico
upload: favicon.ico
//-------- Client side
var my_array = ['a', 'b', 'c'];
$.get('/api/end_point', {arr: JSON.stringify(my_array)}, function(data) { //note that we stringify the array before sending it
//we assume everything went well on the server
}, 'json');
#--------- Server side
import json
from google.appengine.ext import ndb
from datetime import date
class DateTest(ndb.Model):
date = ndb.DateProperty()
d = date(2015, 10, 20)
dt = DateTest()