Skip to content

Instantly share code, notes, and snippets.

@ncweinhold
ncweinhold / main.c
Created May 25, 2011 20:44
Calling Gambit-C scheme functions from C
#include <stdio.h>
#define ___VERSION 406001
#include "gambit.h"
#include "somescheme.h"
#define SCHEME_LIBRARY_LINKER ____20_somescheme__
___BEGIN_C_LINKAGE
@ncweinhold
ncweinhold / gist:985749
Created May 22, 2011 18:55
Getting started with lispbuilder-sdl
(defpackage #:hello-world-sdl
(:use :cl)
(:export :main))
(in-package :hello-world-sdl)
(defparameter *screen-width* 640)
(defparameter *screen-height* 480)
(defparameter *bg-color* sdl:*black*)
(defparameter *text-color* sdl:*white*)
@ncweinhold
ncweinhold / gist:945139
Created April 27, 2011 20:33
First exercises from The Little Schemer using Common Lisp
(defun atom? (x)
(not (listp x)))
(defun lat? (x)
(cond
((null x) t)
((atom? (car x)) (lat? (cdr x)))
(t nil)))
(defun member? (a lat)
@ncweinhold
ncweinhold / gist:924369
Created April 17, 2011 19:11
Quick concurrent f7u12 image downloader - learning gevent
import gevent
from gevent import monkey
from BeautifulSoup import BeautifulSoup
import os
import urllib2
monkey.patch_all()
front_page = "http://www.reddit.com/r/fffffffuuuuuuuuuuuu/"
@ncweinhold
ncweinhold / Learning gevent
Created April 16, 2011 22:06
quick 5 minute script to simple serve a hard coded page
from gevent import monkey
from gevent import wsgi
monkey.patch_all()
PORT = 8080
SIMPLE_PAGE = """<html><head><title>Simple Page</title></head><body><h1>Hello World</h1><p>Simple Gevent Page</p></body></html>"""
def application(env, start_response):