Skip to content

Instantly share code, notes, and snippets.

View bynect's full-sized avatar

nect bynect

  • Laniakea Supercluster
  • 16:52 (UTC +01:00)
View GitHub Profile
@themagicalmammal
themagicalmammal / Optimizations_Void.md
Last active March 6, 2026 11:18
Set of optimizations, I use on my Void Setup

Void Linux — Complete System Optimization Guide

Warning: This guide contains system-level modifications. Some steps are irreversible or can render your system unbootable. Read every section fully before executing any command. Know what you are doing, or do not proceed.


Table of Contents

# Section
@nicuveo
nicuveo / Main.hs
Last active May 12, 2025 10:27
Minimalistic JSON parser, using a Parsec-like approach
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE LambdaCase #-}
import Control.Applicative (liftA2)
import Data.Char
import Data.Foldable (for_)
import Data.Functor
import qualified Data.HashMap.Strict as M
import Data.List (intercalate)
import Prelude hiding (any)
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@iamgreaser
iamgreaser / infix-mode.cl
Last active March 1, 2022 20:23
infix notation for common lisp - first reader macro attempt
;; vim: set sts=2 sw=2 et sm lisp :
(defvar *reading-a-list* nil)
(defun read-terminator (stream char)
(declare (ignore stream))
(error (format nil "unexpected ~S" char)))
(defun get-infix-precedence (symbol)
(case symbol
@nimaai
nimaai / macro-pitfalls.md
Last active November 10, 2024 16:19
Lisp macro pitfalls
@messa
messa / asyncio_ssl_example.py
Created June 26, 2015 12:43
Python asyncio + SSL TCP client/server example
#!/usr/bin/env python3
import asyncio
import multiprocessing
import os
import ssl
from time import sleep
port = 9000
@jozefg
jozefg / infer.sig
Last active February 9, 2022 11:59
A demonstration of type inference in SML
signature TYPEINFER =
sig
type tvar = int
datatype monotype = TBool
| TArr of monotype * monotype
| TVar of tvar
datatype polytype = PolyType of int list * monotype
datatype exp = True
| False
| Var of int
@luser-dr00g
luser-dr00g / xcr.c
Created August 30, 2014 09:35
xcb+cairo hello world window
//xcr.c
//cc -o xcr $(pkg-config --cflags --libs cairo xcb xcb-icccm) xcr.c -lcairo -lxcb -lxcb-icccm
#include <stdlib.h>
#include <string.h>
#include <cairo.h>
#include <cairo-xcb.h>
#include <xcb/xcb.h>
#include <xcb/xcb_image.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_icccm.h>
@jozefg
jozefg / closconv.lhs
Last active June 4, 2025 10:59
Tutorial on Closure Conversion and Lambda Lifting
This is my short-ish tutorial on how to implement closures in
a simple functional language: Foo.
First, some boilerplate.
> {-# LANGUAGE DeriveFunctor, TypeFamilies #-}
> import Control.Applicative
> import Control.Monad.Gen
> import Control.Monad.Writer
> import Data.Functor.Foldable
@ianmackinnon
ianmackinnon / match.c
Created August 8, 2012 12:01
C Regex multiple matches and groups example
# gcc -Wall -o match match.c && ./match
#
#include <stdio.h>
#include <string.h>
#include <regex.h>