Skip to content

Instantly share code, notes, and snippets.

View fons's full-sized avatar
🏠
Working from home

fons haffmans fons

🏠
Working from home
View GitHub Profile
@fons
fons / mongodb-regressio-test
Created August 17, 2012 20:58
mongodb regression test
CL-MONGO-TEST> (quick-test)
---- starting test of package : { test counting documents } ---------------
testing counting : client count : 43 -- server count 43.0d0
---- finished test of package { test counting documents } sucessfully ------
---- starting test of package : { finding documents by field } ---------------
findOne is default : 1
limit == 0 returns all 43 : 43
---- finished test of package { finding documents by field } sucessfully ------
---- starting test of package : { deleting documents } ---------------
---- finished test of package { deleting documents } sucessfully ------
@fons
fons / search-ref.lisp
Created December 7, 2010 02:06
example of the search api in cl-twitter
(define-element search-ref ( (metadata search-ref-metadata))
"An individual search reference"
(id "Integer ID of message" nil)
(text "The text of the tweet" nil)
(to-user "Screen name" nil)
(to-user-id "ID of receiver" nil)
(from-user "Screen name" nil)
(from-user-id "ID of sender" nil)
(iso-language-code "Two character language code for content" nil)
(source "Source of the result" nil)
@fons
fons / collect-frfol.lisp
Created November 29, 2010 22:20
social-graph-search
(defun collect-followers (screen-name)
(let ((lst))
(labels ((collect-it (l)
(setf lst (nconc lst l))))
(with-cursor (:collector #'collect-it :test #'rate-limit-exceeded ) (follower-ids screen-name))) lst))
(defun collect-friends (screen-name)
(let ((lst))
(labels ((collect-it (l)
(setf lst (nconc lst l))))
;
;
; cl-mongo is asdf installable. I'm using sbcl in this demo so I can use require
;
(require :cl-mongo)
;
(require :cl-mongo-test)
;
(use-package :cl-mongo)
;
--common lisp regex engines
http://common-lisp.net/project/cl-irregsexp/
-- John Fremlin teepeedee (he's on github)
http://tlug.jp/meetings/2008/11/serving-dynamic-webpages-in-less-then-a-millisecond_john-fremlin_handout.pdf
--> same pdf http://bit.ly/zwpOA
Earlier overview of building fast servers on linux :
#include <stdio.h>
int main()
{
}