Skip to content

Instantly share code, notes, and snippets.

@cliffcrosland
cliffcrosland / test.c
Last active June 11, 2019 21:23
Demonstration: Old connections are re-used when they shouldn't be
#include <curl/curl.h>
#include <unistd.h>
int main(int argc, char **argv) {
const long maxage_conn = 1L;
curl_global_init(CURL_GLOBAL_ALL);
CURL *easy = curl_easy_init();
curl_easy_setopt(easy, CURLOPT_URL, "https://httpbin.org/get");
@cliffcrosland
cliffcrosland / interpreter_state.rb
Last active August 29, 2015 14:22
Recursive descent parser for fun
class InterpreterState
def initialize
@state = {}
end
def set(identifier, exp)
@state[identifier] = exp
end
def get(identifier)