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
| exports.list = function(req, cb) { | |
| client.get(MODELSET_ID + ":blog:entries", function(err, blogLen) { | |
| if (err) { console.log(err); } | |
| var retList = []; | |
| function done (retBlog) { | |
| console.log("pushing id: " + retBlog.metadata._id); | |
| retList.push(retBlog); | |
| blogLen--; | |
| if (blogLen <= 0) { cb(retList); } |
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 express = require('express'); | |
| var app = express(); | |
| var server = require('http').createServer(app); | |
| var io = require("socket.io").listen(server); | |
| var redis = require('redis'), | |
| db = redis.createClient(); | |
| // Socket.io configuration | |
| io.configure(function () { | |
| io.enable('browser client etag'); |
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
| # The upstream server doesn't need a prefix! no need for wss:// or http:// because nginx will upgrade to http1.1 in the config below | |
| upstream yeomanserver { | |
| server localhost:3000; | |
| } | |
| server { | |
| listen 443; | |
| server_name legionofevil.org; | |
| root html; |
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
| exports.get = function(req, cb) { | |
| if (req.params.id) { | |
| var id = req.params.id; | |
| var ret = {}; | |
| var len = 4; // The number of calls we'll be making | |
| function callback() { | |
| --len || cb(ret); | |
| } | |
| client.hgetall(MODELSET_ID + ":blog:entry:" + id, function(err, reply) { |
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 redis = require("redis"), | |
| client = redis.createClient(); | |
| var MODELSET_ID = "cogblog.v.0.0.0_" | |
| function pad(n) { | |
| return n<10 ? '0'+n : n | |
| } | |
| function add_blog_entry(id) { |
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
| # coding: utf-8 | |
| import urllib2 | |
| from urllib2 import HTTPError | |
| from StringIO import StringIO as stio | |
| from bs4 import BeautifulSoup | |
| import zipfile | |
| import pprint | |
| import simplejson | |
| def robot(): |
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 joyhikeserve as j | |
| from joyhikeserve.db.testdatabase import init_db, drop_db | |
| import unittest | |
| import fixtures | |
| from BeautifulSoup import BeautifulSoup as bs | |
| appurl = "/api/%s" | |
| header = { "content-type": "application/json" } |
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 someapp as j | |
| from someapp.db.database import init_db, drop_db | |
| import unittest | |
| import fixtures | |
| from BeautifulSoup import BeautifulSoup as bs | |
| appurl = "/api/%s" | |
| header = { "content-type": "application/json" } |
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
| ====================================================================== | |
| FAIL: test_login (__main__.JoyHikeDBCase) | |
| ---------------------------------------------------------------------- | |
| Traceback (most recent call last): | |
| File "dbtests.py", line 68, in test_login | |
| assert "logged in as" in rv.data | |
| AssertionError | |
| ====================================================================== | |
| FAIL: test_logout (__main__.JoyHikeDBCase) |