Skip to content

Instantly share code, notes, and snippets.

View AaronC81's full-sized avatar

Aaron Christiansen AaronC81

View GitHub Profile
@AaronC81
AaronC81 / Cargo.toml
Created April 17, 2022 21:58
Delta Pico Simulator
[package]
name = "sim"
version = "0.1.0"
edition = "2021"
[dependencies]
delta-pico-rust = { path = "../rust", default-features = false }
minifb = "0.22.0"
@AaronC81
AaronC81 / tp-link-router-ip.rb
Created April 25, 2021 14:49
Get public IP address of TP-Link router, for dynamic DNS
@AaronC81
AaronC81 / ycma.rb
Created December 2, 2019 17:35
Work out the longest YMCA-able word
class Object
# Deeply clones this object, if it can be marshalled.
def deep_clone
Marshal.load(Marshal.dump(self))
end
end
class String
# Determines whether this string contains only characters from one permutation
# of a given set of choices (excluding any "core" characters).
@AaronC81
AaronC81 / converter.rb
Created October 5, 2019 12:03
Convert a CSV of email addresses into Google Contacts' import format
#!/usr/bin/env ruby
require 'csv'
# This will convert a CSV with a column of email addresses into a valid Google
# Contacts CSV which can be imported.
# Usage: ./converter.rb <input> <output>
# The constants below can be used to configure this script.
# The column of the input CSV, starting from zero, which contains email
@AaronC81
AaronC81 / generate_huge_file.rb
Last active September 16, 2019 13:43
Generate a gigantic Ruby class structure with valid YARD docs, designed for testing Sord
# This is a quick hacky script. It's not supposed to be good Ruby!
# Run with -W0 (because it uses top-level @@) and pipe into a file.
# You also need a valid /usr/share/dict/words file - "pacman -S words" on Arch-based distros
WORDS = File.read('/usr/share/dict/words')
.split("\n")
.select { |w| /^[A-Za-z]{3,}$/ === w }
.map(&:capitalize)
.freeze
@AaronC81
AaronC81 / markdown.rb
Created June 18, 2019 11:04
Markdown LambdaMail Plugin
plugin_info do
id 'core-markdown'
name 'Markdown'
version '1.0.0'
author 'Aaron Christiansen'
description 'Allows the creation of Markdown email sections.'
end
section 'markdown' do
property 'body', :text_area
@AaronC81
AaronC81 / README.md
Last active May 19, 2019 16:22
Reverse-engineering Snapchat Lens Studio's file format

Projects contain at least these three files:

  • A Public directory, which contains image/sound assets
  • A foo.lsproj file, which is a JSON document containing basic project information
  • A project.data file, which is in an unknown binary format.

Projects with an icon assigned will also have an .ico file of their icon.

What is public.data?

@AaronC81
AaronC81 / HuffmanTree.java
Created May 12, 2019 21:15
Practice Paper
package huffman;
import java.util.Map;
public class HuffmanTree {
HuffmanTree left, right;
Character symbol;
public HuffmanTree() {
@AaronC81
AaronC81 / three_credit_check.rb
Created March 25, 2019 19:36
Three credit checker
require 'capybara'
require 'headless'
require 'twilio-ruby'
THREE_USERNAME = ENV['THREE_USERNAME']
THREE_PASSWORD = ENV['THREE_PASSWORD']
TWILIO_SID = ENV['TWILIO_SID']
TWILIO_AUTH = ENV['TWILIO_AUTH']
PHONE = ENV['PHONE']
@AaronC81
AaronC81 / dvd.c
Created March 13, 2019 11:07
DVD animation for HackSoc RPi OS - call rng_init then dvd_animation
#include "framebuffer.h"
#include "main.h"
#include "mem.h"
#include "mailbox.h"
#include "rng.h"
#include <stdbool.h>
#define DVD_LOGO_WIDTH 250
#define DVD_LOGO_HEIGHT 155