Skip to content

Instantly share code, notes, and snippets.

@1000copy
1000copy / hashtable.c
Created February 21, 2024 12:57 — forked from phsym/hashtable.c
An hashtable implementation in C
/*
* Author : Pierre-Henri Symoneaux
*/
#include <stdlib.h>
#include <string.h>
//Hashtable element structure
typedef struct hash_elem_t {
struct hash_elem_t* next; // Next element in case of a collision
@1000copy
1000copy / lisp.cpp
Last active July 5, 2022 06:05 — forked from ofan/lisp.cpp
Lisp interpreter in 90 lines of C++
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <map>
// return given mumber as a string
std::string str(long n) { std::ostringstream os; os << n; return os.str(); }
###
#Step 1 - Generate server certificates etc... (most of this code is horribly ripped off from nodejs docs currently -> http://nodejs.org/docs/latest/api/tls.html)
###
#Assuming your starting from a clean directory
mkdir server
cd server
#generate private key
@1000copy
1000copy / btree.py
Created February 26, 2014 06:47 — forked from teepark/btree.py
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree