Skip to content

Instantly share code, notes, and snippets.

View st235's full-sized avatar
🐈
Senior SWE, Beep Boop Bop

Alex Dadukin st235

🐈
Senior SWE, Beep Boop Bop
View GitHub Profile
@st235
st235 / index.html
Created May 9, 2025 11:19
RI: Local Phaser Breakout
<html>
<head>
<title>RI: Breakout Examples</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser.min.js"></script>
</head>
<body>
<script>
class Breakout extends Phaser.Scene
{
constructor ()
@st235
st235 / macos-distribution.md
Created February 17, 2025 14:00 — forked from rsms/macos-distribution.md
macOS distribution β€” code signing, notarization, quarantine, distribution vehicles
@st235
st235 / main.lua
Last active February 6, 2025 18:52
Dinosaurs Game
WINDOW_WIDTH = 512
WINDOW_HEIGHT = 712
RUNAWAY_HEIGHT = 40
CHARACTER_WIDTH = 24
CHARACTER_HEIGHT = 24
CHARACTER_SCALE = 4
CHARACTER_ANIMATION_CHANGE = 0.065
CHARACTER_VERTICAL_SPEED = -500
@st235
st235 / main.lua
Last active January 26, 2025 11:39
Animated Crow?!
WINDOW_WIDTH = 512
WINDOW_HEIGHT = 916
CROW_WIDTH = 48
CROW_HEIGHT = 48
CROW_ANIMATION_CHANGE = 0.25
function engine.start()
engine.window.setTitle("Animated Crow?!")
engine.window.setWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT)
@st235
st235 / Lua.Exercise32.1.cpp
Last active January 5, 2025 15:23
Programming in Lua. Exercise 32.1
// Exercise 32.1:
// Write a library that allows a script to limit the total amount
// of memory used by its Lua state.
// It may offer a single function, setlimit,
// to set that limit.
// The library should set its own allocation function.
// This function,
// before calling the original allocator,
// checks the total memory in use and returns NULL
@st235
st235 / Lua.Exercise31.3.cpp
Created January 5, 2025 14:04
Programming in Lua. Exercise 31.3
// Exercise 31.3:
// Implement in the lproc library a non-blocking send operation.
#define LUA_COMPAT_MODULE
#define LUA_COMPAT_APIINTCASTS
#include <cstdint>
#include <iostream>
#include <pthread.h>
@st235
st235 / Lua.Exercise31.2.cpp
Created January 5, 2025 13:56
Programming in Lua. Exercise 31.2
// Exercise 31.2:
// Modify the lproc library so that
// it can send and receive other primitive types such as
// booleans and numbers.
// (Hint: you only have to modify the movevalues function.)
#define LUA_COMPAT_MODULE
#define LUA_COMPAT_APIINTCASTS
#include <cstdint>
@st235
st235 / Lua.Exercise30.1.cpp
Created January 4, 2025 15:08
Programming in Lua. Exercise 30.1
// Exercise 30.1:
// Modify the dir_iter function in the directory example
// so that it closes the DIR structure when it reaches
// the end of the traversal.
// With this change,
// the program does not need to wait for a garbage collection
// to release a resource that it knows it will not need anymore.
// (When you close the directory,
// you should set the address stored in the userdatum to NULL,
@st235
st235 / Lua.Exercise29.4.cpp
Created January 3, 2025 13:40
Programming in Lua. Exercise 29.4
// Exercise 29.4:
// Based on the example for boolean arrays,
// implement a small C library for integer arrays.
#define LUA_COMPAT_APIINTCASTS
#include <cmath>
#include <cstdint>
#include <exception>
#include <iomanip>
@st235
st235 / Lua.Exercise29.2+3.cpp
Created January 3, 2025 09:32
Programming in Lua. Exercise 29.2 & 29.3
// Exercise 29.2:
// We can see a boolean array as a set of integers
// (the indices with true values in the array).
// Add to the implementation of boolean arrays
// functions to compute
// the union and intersection of two arrays.
// These functions should receive two arrays and return a new one,
// without modifying its parameters.
// Exercise 29.3: