Skip to content

Instantly share code, notes, and snippets.

View kran's full-sized avatar
🌴
On vacation

Chao’s kran

🌴
On vacation
View GitHub Profile
--[[ config
root = "./"
listen = "127.0.0.1:8786"
redisaddr = "127.0.0.1:6379[1]"
dbfile = root .. "backup.db"
thread = 4
logger = nil
harbor = 1
/* lisp.c: high-speed LISP interpreter */
/* src: http://www.cs.auckland.ac.nz/~chaitin/lisp.c */
/*
The storage required by this interpreter is 8 * 4 = 32 bytes times
the symbolic constant SIZE, which is 32 * 1,000,000 =
32 megabytes. To run this interpreter in small machines,
reduce the #define SIZE 1000000 below.
To compile, type
cc -O -olisp lisp.c
package main
import (
"bufio"
"encoding/json"
"log"
"net/http"
)
func main() {
@chenshuo
chenshuo / query_freq.cc
Created November 3, 2012 22:59
Sort queries by their frequencies.
// answer to http://weibo.com/1915548291/z2UtyzuvQ
// see also http://www.cnblogs.com/baiyanhuang/archive/2012/11/11/2764914.html
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <fstream>
#include <iostream>
@farnoy
farnoy / main.go
Created February 12, 2012 10:38
golang websockets
package main
import (
"websocket"
"http"
"fmt"
"io"
)
func EchoServer(ws *websocket.Conn) {
Hi David,
I came across your profile online and wanted to reach out about Development
Opportunities here at Groupon. The company is growing, and we're always
looking for folks with solid skills that can make positive contribution to
our continued success. Any chance you'd be open to a quick conversation
about opportunities, or for any possible networking potential? If so, let me
know when you're free and we can set up a time to chat. Also, if you are
interested, it would be great if you could forward a current resume over
that I can take a look at. I look forward to hearing back from you! Please
let me know if you have any questions.