Skip to content

Instantly share code, notes, and snippets.

View amPerl's full-sized avatar

Romet Tagobert amPerl

View GitHub Profile
@amPerl
amPerl / main.rs
Created July 1, 2023 16:29
egui todomvc
use eframe::egui::{self, TextBuffer};
#[derive(Clone)]
struct TodoItem {
text: String,
completed: bool,
editing: bool,
}
fn main() {
@amPerl
amPerl / example.rs
Last active August 1, 2023 18:04
ugly egui util to enqueue state-updating closures
use std::sync::Arc;
use eframe::egui::{self, Context};
mod update_queue;
use update_queue::{AppAsyncExt, ContextAsyncExt};
fn main() {
let native_options = eframe::NativeOptions::default();
eframe::run_native(
@amPerl
amPerl / scc_extract.py
Created January 12, 2021 19:01
Extract Fatal Frame ContentFile.scc
import struct
import pathlib
def fatal(msg):
print(msg)
from sys import exit
exit(2)
### Keybase proof
I hereby claim:
* I am amperl on github.
* I am amperl (https://keybase.io/amperl) on keybase.
* I have a public key whose fingerprint is 27E2 0827 BFB1 9A4D 5887 537A A6EF 26B4 522D 9F1A
To claim this, I am signing this object:
@amPerl
amPerl / xlt2json.py
Last active November 11, 2016 12:44
tool to convert Drift City's VehicleUpgrade.xlt into json for easier parsing
import argparse
import os
import json
from collections import defaultdict
def convert(xlt_path, json_path):
xlt = None
with open(xlt_path, 'rb') as f:
xlt = f.read().decode('utf-16').split('\r\n')
@amPerl
amPerl / loftool.py
Created November 8, 2016 19:02
tool to unpack Drift City modeltable0.LOF files
import argparse
import struct
import os
def extract(path, out_path):
try:
os.makedirs(out_path, exist_ok=True)
except OSError:
raise Exception("Couldn't create output path.")