Skip to content

Instantly share code, notes, and snippets.

View rjungemann's full-sized avatar

Roger Jungemann rjungemann

View GitHub Profile
@rjungemann
rjungemann / lbForth.c
Created October 15, 2020 19:59 — forked from lbruder/lbForth.c
A minimal Forth compiler in ANSI C
/*******************************************************************************
*
* A minimal Forth compiler in C
* By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com
* Release 2014-04-04
*
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial
*
* PUBLIC DOMAIN
*
@rjungemann
rjungemann / tiny-vm.ml
Created October 15, 2020 19:59 — forked from gopalindians/tiny-vm.ml
Tiny VM in OCaml - learning
(*
Some time ago I found this tutorial about writing a small VM in c.
http://blog.felixangell.com/blog/virtual-machine-in-c
Here's something similar in OCaml. Nothing super fancy and a lot of room for improvements.
But it's a start :)
*)
open Core.Std
type registers = {
mutable a: int;
@rjungemann
rjungemann / ssss.rb
Created May 10, 2019 21:10 — forked from oleganza/ssss.rb
128-bit Shamir's Secret Sharing Scheme (SSSS) Implementation in Ruby
#!/usr/bin/env ruby -rubygems
# Shamir's Secret Sharing Scheme with m-of-n rule for 128-bit numbers.
# Author: Oleg Andreev <oleganza@gmail.com>
#
# * Deterministic, extensible algorithm: every combination of secret and threshold produces exactly the same shares on each run. More shares can be generated without invalidating the first ones.
# * This algorithm splits and restores 128-bit secrets with up to 16 shares and up to 16 shares threshold.
# * Secret is a binary 16-byte string below ffffffffffffffffffffffffffffff61.
# * Shares are 17-byte binary strings with first byte indicating threshold and share index (these are necessary for recovery).
#
# See also: https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing
@rjungemann
rjungemann / multi.rkt
Created April 9, 2019 00:38
Racket Multimethods, v1
#lang racket
(require compatibility/defmacro
racket/stxparam)
(define-syntax-parameter current-define-multis (make-hash))
(define-syntax-parameter current-define-multi-fns (make-hash))
(define-macro (define-multi name)
(let ([current-define-multis (syntax-parameter-value #'current-define-multis)]
@rjungemann
rjungemann / .bashrc
Created March 6, 2019 20:14 — forked from ae-s/.bashrc
Host-dependent automatic prompt colorization
# Set the gaudy prompt.
# ^O puts terminal back into default text mode for every prompt,
# preventing random glyphs.
resetterm="\[\017\]"
# \[ and \] prevent the shell from counting these characters
# against the line length.
@rjungemann
rjungemann / sdl2_opengl.cpp
Created November 18, 2018 01:11 — forked from jordandee/sdl2_opengl.cpp
Simple SDL2/OpenGL example
// To compile with gcc: (tested on Ubuntu 14.04 64bit):
// g++ sdl2_opengl.cpp -lSDL2 -lGL
// To compile with msvc: (tested on Windows 7 64bit)
// cl sdl2_opengl.cpp /I C:\sdl2path\include /link C:\path\SDL2.lib C:\path\SDL2main.lib /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libcmtd.lib opengl32.lib
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
@rjungemann
rjungemann / sqlite3-cheat-sheet.md
Last active May 31, 2018 02:33 — forked from vincent178/sqlite3-cheat-sheet.md
sqlite3 cheat sheet
@rjungemann
rjungemann / index.html
Last active February 17, 2017 00:00
RxJS and Vue
<div id="app">
{{ message }}
<button v-on:click="increment">+</button>
<button v-on:click="decrement">-</button>
</div>

Keybase proof

I hereby claim:

  • I am rjungemann on github.
  • I am rjungemann (https://keybase.io/rjungemann) on keybase.
  • I have a public key whose fingerprint is 6D74 8E0B 3BCD ED79 7054 5562 956B 774A A512 AA4D

To claim this, I am signing this object:

1: Generate CSR

openssl req -new -newkey rsa:2048 -nodes -keyout server-cert.key -out server-cert-sign-req.csr

# Country Name (2 letter code) [AU]:US
# State or Province Name (full name) [Some-State]:California
# Locality Name (eg, city) []:
# Organization Name (eg, company) [Internet Widgits Pty Ltd]:Flutterby Labs, Inc.
# Organizational Unit Name (eg, section) []:
# Common Name (eg, YOUR name) []:www.dogo.co