Skip to content

Instantly share code, notes, and snippets.

View auramagi's full-sized avatar

Mike Apurin auramagi

View GitHub Profile
@auramagi
auramagi / RoundedButton.swift
Created January 14, 2019 09:11
Rounded opaque buttons for iOS
// Rounded opaque buttons for iOS
// Drop-in replacement for UIButton with Interface Builder support
// UIButton.buttonType type should be set to .custom
// Color is chosen based on the tint color. Supports highlighted and selected states
// Assumes that tint color has high brightness and saturation (e.g. not white or black)
// Written for iOS 12 with Swift 4.2
import UIKit
let kRoundedButtonDefaultFont = UIFont.systemFont(ofSize: 14.0, weight: .medium)
@auramagi
auramagi / decompress_ecd.py
Last active April 26, 2018 08:14
3DS ECD archive decompression
def bit_is_set(byteval,idx):
return ((byteval&(1<<idx))!=0)
def read_int_bbo(f, s, signed=False):
return int.from_bytes(f.read(s), byteorder='big', signed=signed)
def decompressECD(f, out_fname): #file handle at ECD start position, out file name
magic = f.read(3)
if not magic == b'ECD':
return