Skip to content

Instantly share code, notes, and snippets.

View DoctorRainer's full-sized avatar
🏠
Working from home

Rainer Reinhardt DoctorRainer

🏠
Working from home
View GitHub Profile
@DoctorRainer
DoctorRainer / TestServer.hs
Last active September 8, 2019 18:22
JSaddle with statiс files serving
{-# LANGUAGE CPP #-}
module TestServer where
#ifndef ghcjs_HOST_OS
import Network.Wai.Handler.Warp
import Network.Wai.Middleware.Static
import Network.WebSockets (defaultConnectionOptions)
import Language.Javascript.JSaddle.Run (syncPoint)
#!/bin/sh
# run it instead of cabal
find . -maxdepth 2 -name package.yaml -exec hpack {} \;
exec cabal "$@"
@DoctorRainer
DoctorRainer / list.c
Created February 27, 2018 17:14 — forked from pseudomuto/list.c
Blog Code: Implementing a Generic Linked List in C
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "list.h"
void list_new(list *list, int elementSize, freeFunction freeFn)
{
assert(elementSize > 0);
list->logicalLength = 0;