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 unittest, os, os.path, sys, urllib | |
| import tornado.database | |
| import tornado.options | |
| from tornado.options import options | |
| from tornado.testing import AsyncHTTPTestCase | |
| # add application root to sys.path | |
| APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | |
| sys.path.append(os.path.join(APP_ROOT, '..')) |
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
| (ns slouchdb) | |
| ; Fast scalable in-memory concurrent NoSQL database | |
| (def db (ref {:bob {:age 59 :sex :male} | |
| :bill {:age 17 :sex :male} | |
| :mary {:age 28 :sex :female}})) | |
| ;; Views ;; | |
| (defn total-age [] |
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
| (ns comp3.core | |
| (:use compojure.core) | |
| (:require [compojure.route :as route] | |
| [ring.adapter.jetty :as jetty])) | |
| (defn simple-logging-middleware [app] | |
| (fn [req] | |
| (println req) | |
| (app req))) |
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
| require 'rubygems' | |
| require 'rack' | |
| class Object | |
| def webapp | |
| class << self | |
| define_method :call do |env| | |
| func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
| [200, {}, send(func, *attrs)] | |
| 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
| ;; When executed, this file will run a basic web server | |
| ;; on http://localhost:8080, which will tell you how many | |
| ;; times you have visited the page. | |
| (ns ring.example.session | |
| (:use ring.middleware.session | |
| ring.util.response | |
| ring.adapter.jetty)) | |
| (defn handler [{session :session, uri :uri}] |
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
| # how to name keys in redis for keyvalue stores | |
| http://code.google.com/p/redis/wiki/TwitterAlikeExample | |
| http://rediscookbook.org/introduction_to_storing_objects.html | |
| http://www.slideshare.net/playnicelyapp/redis-schema-design-for-playnicely-redis-london-meetup | |
| antirez has a book about keyvalue design in the pipeline | |
| http://code.google.com/p/redis/wiki/IntroductionToRedisDataTypes | |
| schema: | |
| <namespace>:<globalObject> |
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
| ; dependencies: | |
| ; http://build.clojure.org/releases/org/clojure/clojure/1.2.0/clojure-1.2.0.jar | |
| ; http://github.com/downloads/sirthias/parboiled/parboiled4j-0.9.8.2.jar | |
| ; http://github.com/downloads/sirthias/pegdown/pegdown-0.8.5.3.jar | |
| (import 'org.pegdown.PegDownProcessor) | |
| (def input-text " | |
| A First Level Header | |
| ==================== |
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
| # Author: Jacob Kristhammar, 2010 | |
| # | |
| # Updated version of websocket.py[1] that implements latest[2] stable version | |
| # of the websocket protocol. | |
| # | |
| # NB. It's no longer possible to manually select which callback that should | |
| # be invoked upon message reception. Instead you must override the | |
| # on_message(message) method to handle incoming messsages. | |
| # This also means that you don't have to explicitly invoke | |
| # receive_message, in fact you shouldn't. |
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
| ''' | |
| redis_search.py | |
| Written by Josiah Carlson July 3, 2010 | |
| Released into the public domain. | |
| This module implements a simple TF/IDF indexing and search algorithm using | |
| Redis as a datastore server. The particular algorithm implemented uses the |
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
| /* | |
| * AppController.j | |
| * imdbdemo | |
| * | |
| * Created by Randy Luecke on July 2, 2010. | |
| * Copyright 2010, RCLConcepts, LLC All rights reserved. | |
| */ | |
| @import <Foundation/CPObject.j> | |
| @import <AppKit/CPScrollView.j> |