Skip to content

Instantly share code, notes, and snippets.

View bollu's full-sized avatar

Siddharth bollu

View GitHub Profile
; Emulating cps call using LLVM Coroutines
; RUN: opt coro-cps.ll -O2 -enable-coroutines -S
define void @f(i32 %arg) {
entry:
%bar.ret.addr = alloca i32
%id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null)
%size = call i32 @llvm.coro.size.i32()
%alloc = call i8* @malloc(i32 %size)
%hdl = call noalias i8* @llvm.coro.begin(token %id, i8* %alloc)
@fnky
fnky / ANSI.md
Last active May 2, 2024 14:30
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

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

A quadratic space is a real vector space V with a quadratic form Q(x), e.g. V = R^n with Q as the squared length. The Clifford algebra Cl(V) of a quadratic space is the associative algebra that contains V and satisfies x^2 = Q(x) for all x in V. We're imposing by fiat that the square of a vector should be the quadratic form's value and seeing where it takes us. Treat x^2 = Q(x) as a symbolic rewriting rule that lets you replace x^2 or x x with Q(x) and vice versa whenever x is a vector. Beyond that Cl(V) satisfies the standard axioms of an algebra: it lets you multiply by scalars, it's associative and distributive, but not necessarily commutative.

Remarkably, this is all you need to derive everything about Clifford algebras.

Let me show you how easy it is to bootstrap the theory from nothing.

We know Cl(V) contains a copy of V. Since x^2 = Q(x) for all x, it must also contain a copy of some nonnegative reals.

@derofim
derofim / crsl.cpp
Created March 10, 2019 09:08 — forked from andrew-pa/crsl.cpp
Cairo, GL, SDL together
#include <iostream>
#include <cairo/cairo.h>
#include <cairo/cairo-gl.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_syswm.h>
int main(int argc, char* argv[]) {
SDL_Init(SDL_INIT_VIDEO);
auto win = SDL_CreateWindow("crsl", 300, 300, 512, 512, SDL_WINDOW_OPENGL);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
@chrisdiana
chrisdiana / opz-cheatsheet.md
Last active March 29, 2024 01:25
OP-Z Cheatsheet

OP-Z Cheatsheet

General

  • Play: Press Play
  • Stop: Press Stop
  • Sequence: Hold Trig + key
  • Sequence v2: Hold Rec + keys
  • Live Record: Hold Rec + Play + key/Play
  • Stop Recording: Press Rec