Skip to content

Instantly share code, notes, and snippets.

View jwdevantier's full-sized avatar

Jesper Wendel Devantier jwdevantier

  • Samsung Electronics, SSDR
  • Copenhagen
View GitHub Profile
{ python3Packages
, python-libclang
, fetchFromGitHub
, libclang
, lib
, clang
, glibc
}:
let
buildPythonPackage = python3Packages.buildPythonPackage;
{ stdenv, coreutils, gcc }:
stdenv.mkDerivation {
name = "hello";
# Source Code
# See: https://nixos.org/nixpkgs/manual/#ssec-unpack-phase
src = ./src;
# Dependencies
# See: https://nixos.org/nixpkgs/manual/#ssec-stdenv-dependencies
pseud@pseudotop:~/GolandProjects/daemonload$ make build && time ./spammer -e localhost:11776 -p tcp spam -j 3 -s 180 --d 0
go build ./cmd/echosrv
go build ./cmd/spammer
Job Params
===========
Jobs: 3
Duration: 180s
Delay: 0msecs
Protocol: tcp
Endpoint: localhost:11776
@jwdevantier
jwdevantier / echo-server.rkt
Created February 5, 2022 19:18
TCP echo server in racket using break-thread to stop threads and custodians for cleanup.
#lang racket
(require racket/tcp)
(struct server
(custodian
client-handler
[listener #:mutable]
client-threads
[main-thread #:mutable])
#:transparent)
@jwdevantier
jwdevantier / docker-compose.yml
Created May 12, 2021 12:45
base traefik setup
# Basic setup with traefik
#
# To use:
# create network (docker network create traefik)
# change email (certificatesresolvers.myresolver.acme.email)
# Create new services which
# - configures.
version: "3.3"
services:
@jwdevantier
jwdevantier / example.py
Created October 19, 2020 10:59
Shows how to effectively wrap some function (runner) with a series of (async) context managers.
import asyncio
from contextlib import asynccontextmanager, AsyncExitStack
import typing as t
ContextList = t.List[t.AsyncContextManager]
@asynccontextmanager
async def ctx(name):
try:
print(f"{name} before")
@jwdevantier
jwdevantier / App.fs
Created September 7, 2020 09:19
Fable (F# to JS), Elmish (Elm architecture for F#) and React for rendering.
module App
open Fable.React
open Fable.React.Props
type Model = {Count: int}
type Msg = Incr | Decr
let init () =
{Count = 0}
@jwdevantier
jwdevantier / App.fs
Created September 7, 2020 09:16
Fable + Elmish + React example
module App
open Fable.React
open Fable.React.Props
open Elmish
open Elmish.React
open Elmish.Navigation
type Route =
;;; -*- lexical-binding: t; -*-
(require 'cl-lib)
;; lexical binding makes it possible to write functions which return closures
;; that behave as expected (e.g. capture their local environment)
;; cl-lib is the newer, recommended way to tap into the large subset of
;; common lisp functions/macros
@jwdevantier
jwdevantier / docker-compose.yml
Created September 5, 2017 09:25
Example docker CE deployment setup
version: "3.3"
services:
gitlab:
image: 'gitlab/gitlab-ce:9.5.2-ce.0'
restart: always
hostname: 'git.example.com'
links:
- postgresql:postgresql