Skip to content

Instantly share code, notes, and snippets.

View Ryman's full-sized avatar

Kevin Butler Ryman

  • Berlin
View GitHub Profile
@Ryman
Ryman / natto-eval.js
Created March 1, 2024 11:47 — forked from paulshen/natto-eval.js
natto.dev eval pseudocode
const f = useMemo(() => {
try {
return new Function('inputs', `return ${expression}`);
} catch (e) {
return [e];
}
}, [expresssion]);
// input atoms
@Ryman
Ryman / generate.c
Created February 22, 2024 13:43 — forked from munificent/generate.c
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@Ryman
Ryman / Dockerfile
Created January 14, 2024 19:23 — forked from adtac/Dockerfile
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@Ryman
Ryman / Twin Vaklyr Hover analysis.txt
Created December 26, 2023 17:21 — forked from chaodhib/Twin Vaklyr Hover analysis.txt
Twin Vaklyr Hover analysis
// ---------------------------------------------------------------------
// 1) creation of the one of the 2 twins.
// ---------------------------------------------------------------------
ServerToClient: SMSG_COMPRESSED_UPDATE_OBJECT (0x01F6) Length: 365 ConnIdx: 0 Time: 03/20/2010 15:15:00.000 Number: 286284
[4] UpdateType: CreateObject2
[4] GUID: Full: 0xF1300086C1003546 Type: Creature Entry: 34497 (Fjola Lightbane) Low: 13638
[4] Object Type: Unit (3)
[4] Update Flags: Living, StationaryObject (96)
[4] Movement Flags: Hover (1073741824)
[4] Extra Movement Flags: None (0)
@Ryman
Ryman / 00_README.md
Created December 21, 2023 21:36 — forked from LeZuse/00_README.md
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)

Node.js on Apple Silicon

Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.

TODO

  • find a way how to run the same node version on both platforms
@Ryman
Ryman / roflcopter.md
Created December 16, 2023 16:38 — forked from MatthewRalston/roflcopter.md
ROFLcopter ASCII text art

ROFLcopter ASCII

If you hear SOI SOI SOI, you better RUN RUN RUN ’cause the ROFLCOPTER ASCII army is coming for you!

THE ORIGINAL ROFLCOPTER

 ROFL:ROFL:ROFL:ROFL
         _^___
 L __/ [] \
@Ryman
Ryman / jq-cheetsheet.md
Created September 8, 2023 19:24 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@Ryman
Ryman / programming-as-theory-building.md
Created June 18, 2023 00:03 — forked from onlurking/programming-as-theory-building.md
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@Ryman
Ryman / lmdb.tcl
Created May 29, 2023 04:30 — forked from antirez/lmdb.tcl
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@Ryman
Ryman / useMyAwesomeHook.specs.tsx
Created April 8, 2023 14:12 — forked from Danetag/useMyAwesomeHook.specs.tsx
Testing a React hook with a redux store
import React from 'react';
import { renderHook } from '@testing-library/react-hooks';
import stateFactory from 'jest/stateFactory';
import configureMockStore from 'redux-mock-store';
import { Provider } from 'react-redux';
import { Store, AnyAction } from 'redux';
import { initialState as initialPaginationState } from '../../store/pagination/reducer';
import { useMyAwesomeHook } from '../useMyAwesomeHook';