Skip to content

Instantly share code, notes, and snippets.

View djanatyn's full-sized avatar

Jonathan Strickland djanatyn

View GitHub Profile
@saolsen
saolsen / .Rust_Vals.md
Last active December 26, 2023 00:29
Rust Val

Make a Val with rust.

Build a https://www.val.town/ val with rust. This is an example of how to compile a rust file to wasm and use it as a val.

Requires rust, wasm-pack and deno.

Usage

  • Put your code in val.rs.
  • Build it.
@typeswitch-dev
typeswitch-dev / minimal.asm
Created September 2, 2022 17:07
Minimal win64 executable in NASM assembly.
org 0 ; We use "org 0" so Relative Virtual Addresses (RVAs) are easy.
; This means that when we want an absolute Virtual Address we have
; to add IMAGE_BASE to the RVA (or whatever the base of that section is)
IMAGE_BASE equ 0x400000
SECT_ALIGN equ 0x200
FILE_ALIGN equ 0x200
msdos_header:
.magic db 'MZ'
@jessejputnam
jessejputnam / array_methods_cheats.md
Created August 16, 2022 12:57
A cheatsheet for choosing JavaScript array methods

Choosing an array method

I want to...

Mutate the original array

  • Add to original:
arr.push
arr.unshift
@belkarx
belkarx / lemonbar.sh
Created July 22, 2022 20:42
lemonbar.sh
#!/usr/bin/bash
Clock(){
TIME=$(date "+%H:%M:%S")
echo -e -n " \uf017 ${TIME}"
}
Cal() {
DATE=$(date +"%Y/%m/%d [%a]")
@kpmcc
kpmcc / tree.c
Created May 23, 2022 19:21
Simple tree example
// preprocessor macro - basically copies tree.h and puts
// the contents where the include goes
#include <stdio.h>
#include <stdlib.h>
#include "tree.h"
int print_tree_hello() {
module Demo where
-- notice many of these don't have type signatures.
-- Haskell is smart enough figure out 99% of the type signatures for you.
-- any type signatures here are just to add clarity.
-- number
somenumber = 1
-- string
@ycz
ycz / dsmashLoading.js
Created October 22, 2021 22:12
6 Minutes of Down Smash 0-Deaths source code
const fs = require("fs");
const { SlippiGame } = require("@slippi/slippi-js");
const DSMASH_MOVE_ID = 12;
const SAMUS_ID = 16;
const BASE_DIR = "/mnt/c/Users/ycz/Documents/Slippi/Archive";
const RECORDS_FILE = "./dsmashStarts.json";
let loadedRecords;
try {
@vivshaw
vivshaw / README.md
Last active May 2, 2022 20:55
🙈🙉🙊 Three Wise Monkeys 🙈🙉🙊
@SciresM
SciresM / spelunky2_extract.py
Created September 30, 2020 11:44
Quick and dirty Spelunky 2 asset extraction. Assets are a weird chacha20 variant, there are at least two cryptographic errors due to typos....
import zstd
from struct import pack as pk, unpack as up
import subprocess as sp
# Quick and dirty Spelunky 2 asset extraction, author SciresM.
# Assets are protected by a weird chacha20 variant.
# The developers made an unfortunate set of typos that
# significantly weakens the asset crypto...
def rotate_left(a, b):
#!/usr/bin/awk -f
function line(x1, y1, x2, y2) {
printf(" <line x1='%d' y1='%d' x2='%d' y2='%d'/>\n",
x1, y1 + rand() * 5, x2, y2 + rand() * 10)
}
function path(d) {
printf(" <path d='%s'/>\n", d)
}