Skip to content

Instantly share code, notes, and snippets.

Avatar
🐶
need to find a job for life

Lisprez

🐶
need to find a job for life
  • Hong Kong
View GitHub Profile
@Lisprez
Lisprez / epoll.go
Created Mar 29, 2019 — forked from tevino/epoll.go
Golang example for using epoll
View epoll.go
package main
import (
"fmt"
"net"
"os"
"syscall"
)
const (
@Lisprez
Lisprez / singleton.hpp
Created Mar 29, 2019 — forked from bianjiang/singleton.hpp
A C++11 singleton template with variadic parameters support
View singleton.hpp
//
// __SINGLETON_HPP__
//
// The MIT License (MIT)
// Copyright (c) <2013> <Jiang Bian jbian@uams.edu>
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
View tinylisp.py
import re, sys # this file requires python 3
def parse(tokens):
stack = ([], None)
for t in tokens:
if t == '(':
stack = ([], stack)
elif t == ')':
(finished_list, stack) = stack
stack[0].append(finished_list)
elif not t.startswith(';;'):
@Lisprez
Lisprez / lisp.c
Created Jul 25, 2018 — forked from sanxiyn/lisp.c
Lisp
View lisp.c
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
enum type {
NIL,