Skip to content

Instantly share code, notes, and snippets.

View deckarep's full-sized avatar
🎯
Focusing

Ralph Caraveo deckarep

🎯
Focusing
View GitHub Profile
@deckarep
deckarep / rmSidewalk.py
Last active January 25, 2024 19:11
WTF - SCI Script to Python3 - experiment to modernize the SCI source code...
# Hello, before anyone freaks out this is just an experiment...to see how far the rabbit hole can go.
# Original .sc file for ref: https://github.com/EricOakford/SCI-Decompilation-Archive/blob/master/lsl1/src/rmSidewalk.sc
# SCI script is really interesting to me, but largely outdated
# Based on a combination of Small-Talk and Lisp, with Prefix notation for expressions...it can get unwieldy
# to read at least for me. Boat-load of paranthesis and expressions that don't read like normal infix notation.
# But,
@deckarep
deckarep / align_asm.py
Created November 10, 2023 02:02
A quick and dirty work-in-progress script that can help align blocks of assembly language since doing it manually is tedious and boring and hurts my eyes.
#!/usr/bin/env python3
import sys
class NasmAligner:
def __init__(self, start_address=0):
self.alignments = {'DB': 1, 'DW': 2, 'DD': 4, 'DQ': 8}
self.output_lines = []
self.current_address = start_address
@deckarep
deckarep / alignof.py
Created November 9, 2023 04:57
A stupid simple Python utility to quickly print out the alignment of an integer provided on the command line.
import sys
def check_alignment(val):
alignments = {
'2-byte': val & 0x1 == 0,
'4-byte': val & 0x3 == 0,
'8-byte': val & 0x7 == 0,
'16-byte': val & 0xF == 0,
'32-byte': val & 0x1F == 0,
'64-byte': val & 0x3F == 0,
@deckarep
deckarep / main.go
Last active October 11, 2022 20:28
KQ6 - Hires Portrait Extractor
package main
import (
"encoding/binary"
"fmt"
"image"
"image/color"
"image/png"
"io/ioutil"
"log"
@deckarep
deckarep / rand.6502.asm
Created January 23, 2021 06:49
6502 assembly - simple RAND subroutine
rand equ $04
;uint8_t next_rnd(void)
;{
; static uint8_t rnd;
; rnd = rnd * 5 + 17;
; return rnd;
;}
; returns a pseudo rand store at memory location: rand
@deckarep
deckarep / main.go
Created July 2, 2020 01:23
Protobuf Talk: Populating and serializing a dog into bytes
package main
// to run: go run *.go
import (
fmt "fmt"
"log"
proto "github.com/gogo/protobuf/proto"
)
@deckarep
deckarep / dog.proto
Created July 2, 2020 01:22
Protobuf Talk: Dog schema definition
syntax = "proto2";
option go_package = "main";
message Dog {
required int32 owner_id= 1;
optional string breed = 2;
optional float height_in = 3;
optional string color = 4;
}
@deckarep
deckarep / dog.pb.go
Last active July 2, 2020 01:26
Protobuf Talk: Output of protoc command.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: dog.proto
package main
import (
encoding_binary "encoding/binary"
fmt "fmt"
github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
proto "github.com/gogo/protobuf/proto"
@deckarep
deckarep / keybase.md
Created March 18, 2019 17:23
My keybase ya’ll

Keybase proof

I hereby claim:

  • I am deckarep on github.
  • I am deckarep (https://keybase.io/deckarep) on keybase.
  • I have a public key ASCILfCZPwyCR_n1T7aot_Nq9xjLhXrkYoKZRX-deNXGrwo

To claim this, I am signing this object:

@deckarep
deckarep / index.html
Created November 18, 2017 00:15 — forked from kirjavascript/index.html
d3 webGL force graph with PIXI.js
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<title>d3 webGL force graph with PIXI.js</title>
<meta name="description" content="">
<meta name="theme-color" content="#000000">
</head>
<body>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default"></script>