Skip to content

Instantly share code, notes, and snippets.

View Terkwood's full-sized avatar
🦑

Terkwood Terkwood

🦑
  • Salesforce
  • Indiana, USA
  • 13:20 (UTC -04:00)
View GitHub Profile
@Terkwood
Terkwood / stunnel init script
Last active June 21, 2018 16:59 — forked from hoegertn/init script
stunnel init script
#!/bin/sh
#
# stunnel Start/Stop the stunnel daemons
#
# description: stunnel is a script that runs stunnel daemons
# version 1.00
#
# chkconfig: 345 40 60
#
# processname: stunnel
@Terkwood
Terkwood / dummy-web-server.py
Last active August 19, 2018 16:40 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python3
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@Terkwood
Terkwood / netlify.sh
Created March 8, 2019 12:56 — forked from lightdiscord/netlify.sh
Rust and wasm and netlify
#!/usr/bin/env bash
set -e
cweb_version=0.6.16
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz
curl -Lo cargo-web.gz $cweb
gunzip cargo-web.gz
chmod u+x cargo-web
@Terkwood
Terkwood / README.md
Created August 6, 2019 02:29 — forked from kacole2/README.md
EBS and EFS Volumes with Docker For AWS using REX-Ray

EBS and EFS Volumes with Docker For AWS using REX-Ray

This procedure will deploy Docker For AWS and go through the steps to build REX-Ray containers. This process will have some hiccups because Docker for AWS will provision resources in different availability zones (AZs). Multiple workers/agents will be spread across AZs (not regions) which means a potential host failure will trigger Swarm to restart containers that could spread across an AZ. If a container is restarted in a different AZ, the pre-emption mechanism for REX-Ray will not work because it no longer has access to the volume in the former AZ.

Deploy Docker for AWS.

Launch Stack

SSH into one of your Docker Manager Nodes

$ sudo vim /etc/systemd/system/docker-compose.service
[Unit]
Description=DockerCompose
After=docker.service
Requires=docker.service
[Service]
ExecStart=/opt/bin/docker-compose -f /home/core/docker-compose.yml up -d
@Terkwood
Terkwood / build_VC4CL_rpi_3Bplus.sh
Last active March 1, 2020 16:17 — forked from aumouvantsillage/Building VC4CL
Building VC4C and VC4CL on a Raspberry Pi 3 with Raspbian Stretch
sudo apt install git cmake clang-3.9 opencl-headers ocl-icd-dev ocl-icd-opencl-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 100
git clone https://github.com/doe300/VC4C.git
git clone https://github.com/doe300/VC4CL.git
git clone https://github.com/doe300/VC4CLStdLib.git
cd VC4C
cmake -DBUILD_TESTING=OFF -DSPIRV_FRONTEND=OFF
@Terkwood
Terkwood / README.md
Created March 20, 2020 22:21 — forked from tetkuz/README.md
GStreamer stream to HTML5

Description

[Server] GStreamer ---> HTML [Client]

Require

  • gstreamer-1.x
  • Browser which supports video tag of HTML5

debian

@Terkwood
Terkwood / brainfuck.hs
Created April 23, 2020 14:41
A brainfuck interpreter written in Haskell typeclasses
{-# LANGUAGE
TypeOperators, MultiParamTypeClasses, FunctionalDependencies,
FlexibleInstances, UndecidableInstances
#-}
module Brainfuck where
{- Usage:
Programs are encoded as cons-lists chained by (:-) and terminated by C0.
@Terkwood
Terkwood / writeup.md
Created November 30, 2020 17:14 — forked from edmundsmith/writeup.md
Method for Emulating Higher-Kinded Types in Rust

Method for Emulating Higher-Kinded Types in Rust

Intro

I've been fiddling about with an idea lately, looking at how higher-kinded types can be represented in such a way that we can reason with them in Rust here and now, without having to wait a couple years for what would be a significant change to the language and compiler.

There have been multiple discussions on introducing higher-ranked polymorphism into Rust, using Haskell-style Higher-Kinded Types (HKTs) or Scala-looking Generalised Associated Types (GATs). The benefit of higher-ranked polymorphism is to allow higher-level, richer abstractions and pattern expression than just the rank-1 polymorphism we have today.

As an example, currently we can express this type:

@Terkwood
Terkwood / gist:89348347bb11ed58d7b38c1d5217de67
Created January 17, 2021 14:02 — forked from danking/gist:1068185
A very simple example showing how to use Racket's lexing and parsing utilities
#lang racket
(require parser-tools/lex
(prefix-in re- parser-tools/lex-sre)
parser-tools/yacc)
(provide (all-defined-out))
(define-tokens a (NUM VAR))
(define-empty-tokens b (+ - EOF LET IN))
(define-lex-trans number
(syntax-rules ()