Skip to content

Instantly share code, notes, and snippets.

View theteachr's full-sized avatar
👨‍💻
Teaching

Nick theteachr

👨‍💻
Teaching
View GitHub Profile
@ClarkeRemy
ClarkeRemy / calc.prolog
Created January 24, 2024 17:04
Prolog S-expr
:- module(calc, [tokens//1, ast//1, ast_eval/2, eval_formatted/2, source_eval/2, source_evalFormatted/2]).
:- use_module(library(clpz)).
:- use_module(library(dcgs)).
:- use_module(library(lists)).
:- use_module(library(charsio)).
:- use_module(library(dif)).
:- use_module(library(debug)).
/** S-expression calculator
@ForgotMyCode
ForgotMyCode / ll.h
Created April 4, 2023 01:14
Generic Linked List in C (Experimental)
#include <stdlib.h>
#define INTERNAL__CONCAT_2ARGS(LHS, RHS) LHS##RHS
#define INTERNAL__CONCAT_3ARGS(A, B, C) A##B##C
#define INTERNAL__MAKE_INNER_TYPENAME(LL_DECLNAME, TYPE) INTERNAL__CONCAT_3ARGS(INTERNAL__, LL_DECLNAME, INNER_TYPE)
#define INTERNAL__MAKE_INTERNAL_FUNCTION_NAME(LL_DECLNAME, FUNCTION_NAME) INTERNAL__CONCAT_3ARGS(INTERNAL__, LL_DECLNAME, FUNCTION_NAME)
#define INTERNAL__MAKE_INTERNAL_NODE_NAME(LL_DECLNAME) INTERNAL__CONCAT_3ARGS(INTERNAL__, LL_DECLNAME, _LL_Node)
#define INTERNAL__MAKE_INTERNAL_STRUCTED_NAME(LL_DECLNAME) INTERNAL__CONCAT_3ARGS(INTERNAL__STRUCTED_, LL_DECLNAME, _LL_Type)
#define INTERNAL__MAKE_INTERNAL_STRUCTED_NODE_NAME(LL_DECLNAME) INTERNAL__CONCAT_3ARGS(INTERNAL__STRUCTED_, LL_DECLNAME, _LL_Node)
@fnky
fnky / ANSI.md
Last active June 2, 2024 17:38
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27