Skip to content

Instantly share code, notes, and snippets.

@seanjensengrey
seanjensengrey / tiny.c
Last active October 22, 2025 01:26
Marc Feeley Tiny C compiler
/* file: "tinyc.c" */
/* originally from http://www.iro.umontreal.ca/~felipe/IFT2030-Automne2002/Complements/tinyc.c */
/* Copyright (C) 2001 by Marc Feeley, All Rights Reserved. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
@bkaradzic
bkaradzic / orthodoxc++.md
Last active December 16, 2025 11:18
Orthodox C++

Orthodox C++

This article has been updated and is available here.

Configure | 48 +-
Makefile.org | 4 +-
apps/speed.c | 30 +-
crypto/chacha20poly1305/Makefile | 92 +++
crypto/chacha20poly1305/asm/chacha20_avx.pl | 389 ++++++++++++
crypto/chacha20poly1305/asm/chacha20_avx2.pl | 425 +++++++++++++
crypto/chacha20poly1305/asm/poly1305_avx.pl | 718 +++++++++++++++++++++
crypto/chacha20poly1305/asm/poly1305_avx2.pl | 919 +++++++++++++++++++++++++++
crypto/chacha20poly1305/chacha20.c | 158 +++++
crypto/chacha20poly1305/chacha20poly1305.h | 77 +++
@orlp
orlp / chacha.h
Last active August 18, 2025 14:08
C++11 ChaCha implementation.
/*
Copyright (c) 2024 Orson Peters <[email protected]>
This software is provided 'as-is', without any express or implied warranty. In no event will the
authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the
@stephanh42
stephanh42 / stddev.fs
Created October 29, 2014 19:24
Computing mean and population standard deviation in Forth.
\ Computing mean and population standard deviation in Forth.
\ Tested on Gforth 0.7.0
16 constant FRAC \ number of bits behind fixed-point
\ convert from/to fixed point representation
: s>fix FRAC lshift ;
: fix>s FRAC rshift ;
\ fixed-point arithmetic
@socrateslee
socrateslee / static-serve.go
Created June 18, 2014 14:56
Serving static files in current directory with golang. Simply a "python -m SimpleHTTPServer [PORT]" replacement written in golang. Use it as "static-serve [PORT]"
package main
import (
"net/http"
"os"
"fmt")
func main() {
port := "8080"
if len(os.Args) >= 2 {
@lbruder
lbruder / lbForth.c
Created April 6, 2014 15:21
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
*
@t32k
t32k / foobar.md
Created September 25, 2013 02:05
foo, bar, baz, qux, quux, corge, grault, garply, waldo, fred, plugh, xyzzy, thud
@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;