This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env luajit2 | |
local ffi = require 'ffi' | |
ffi.cdef [[ | |
int glfwInit(void); | |
void glfwTerminate(void); | |
void glfwWindowHint(int hint, int value); | |
void* glfwCreateWindow(int width, int height, const char *title, void *monitor, void *share); | |
void glfwDestroyWindow(void *window); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <errno.h> | |
#include <fcntl.h> | |
#include <linux/fs.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/ioctl.h> | |
#include <sys/mman.h> | |
#include <unistd.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import ctypes | |
import threading | |
import time | |
import tkinter as tk | |
def _main() -> None: | |
done = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.bezier as bezier | |
if __name__ == '__main__': | |
seg = bezier.BezierSegment([ | |
(0, 0), | |
(16, 40), | |
(32, -32), | |
]) | |
seg2 = bezier.BezierSegment([ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef DYNAMIC_ARRAY_H | |
#define DYNAMIC_ARRAY_H | |
#ifndef DYNAMIC_ARRAY_MALLOC | |
#include <stdlib.h> | |
#define DYNAMIC_ARRAY_MALLOC malloc | |
#endif | |
#ifndef DYNAMIC_ARRAY_REALLOC | |
#include <stdlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module | |
(func $Vector2Add (export "Vector2Add") (param f32) (param f32) (param f32) (param f32) (result f32) (result f32) | |
local.get 0 | |
local.get 2 | |
f32.add | |
local.get 1 | |
local.get 3 | |
f32.add | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import re | |
from enum import auto, IntEnum | |
from typing import Any | |
re_number = re.compile(r'[0-9]+(.[0-9]+)?') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "array.h" | |
typedef Array(int) IntArray; | |
int main(void) { | |
IntArray a; | |
size_t i; | |
array_init(&a); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef ARRAY_H | |
#define ARRAY_H | |
#include <stddef.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define Array(T)\ | |
struct {\ | |
T *data;\ |
NewerOlder