Skip to content

Instantly share code, notes, and snippets.

@tyrone-sudeium
tyrone-sudeium / update-teamcraft.sh
Created December 16, 2023 07:50
FFXIV Teamcraft Installer/Updater for Linux / WINE
#!/bin/bash
command -v jq >/dev/null 2>&1 || { echo >&2 "jq required. Install it and try again."; exit 1; }
command -v curl >/dev/null 2>&1 || { echo >&2 "curl required. Install it and try again."; exit 1; }
command -v 7z >/dev/null 2>&1 || { echo >&2 "7z required. Install it and try again."; exit 1; }
verlte() {
printf '%s\n' "$1" "$2" | sort -C -V
}

Keybase proof

I hereby claim:

  • I am tyrone-sudeium on github.
  • I am aethe (https://keybase.io/aethe) on keybase.
  • I have a public key ASDvu4FluJD-WERV-KAwZzJccTLsZoUJTLdNt-iDRd3OaAo

To claim this, I am signing this object:

@tyrone-sudeium
tyrone-sudeium / .zshrc
Last active June 27, 2022 16:46
My minimal zshrc, which sets up my standard prompt, saves zsh history to disk, sets the nice history searching up/down arrow behaviour, all without oh-my-zsh, which means new terminal windows open in milliseconds
# Set prompt
autoload -U promptinit; promptinit
export PATH=$PATH:$HOME/bin
# Set my lightweight prompt
export PROMPT='%{%F{cyan}%}[%2c% ]%F{red}$ %f'
# Set history settings -- stolen wholesale from oh-my-zsh because it's good and the built-ins are not
function omz_history {
@tyrone-sudeium
tyrone-sudeium / canvas.d.ts
Last active June 8, 2018 06:39
A first attempt at a Typescript Type Definition for https://github.com/Automattic/node-canvas
/// <reference types="node" />
declare module "canvas" {
import { Readable } from "stream"
type CanvasType = "pdf" | "svg"
interface NodeCanvasRenderingContext2D extends CanvasRenderingContext2D {
patternQuality: "fast" | "good" | "best" | "nearest" | "bilinear"
textDrawingMode: "path" | "glyph"
filter: "fast" | "good" | "best" | "nearest" | "bilinear"
@tyrone-sudeium
tyrone-sudeium / MethodsByLength.m
Created January 25, 2017 04:48
Gets every method in the current binary image (not in linked frameworks or dylibs) and orders them in a CSV by length
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
int main(int argc, char *argv[])
{
unsigned int imageCount = 0;
const char** imageNames = objc_copyImageNames(&imageCount);
const char* thisImage = imageNames[imageCount-1];
unsigned int numberOfClasses = 0;
const char** classNames = objc_copyClassNamesForImage(thisImage, &numberOfClasses);
@tyrone-sudeium
tyrone-sudeium / MethodsByLength.m
Last active January 25, 2017 04:49
Gets every method in the current objc runtime and orders them in a CSV by length
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
int main(int argc, char *argv[])
{
int numberOfClasses = objc_getClassList(NULL, 0);
Class *classes = NULL;
classes = (__unsafe_unretained Class *)malloc(numberOfClasses * sizeof(Class));
numberOfClasses = objc_getClassList(classes, numberOfClasses);
NSMutableDictionary *methodsByLength = [NSMutableDictionary new];
@tyrone-sudeium
tyrone-sudeium / Binaryuuid.swift
Created January 21, 2015 12:37
Get the current running executable's binary UUID
func binaryUUID() -> NSUUID? {
var executableHeader = UnsafePointer<mach_header>()
for var i = UInt32(0); i < _dyld_image_count(); i++ {
let header = _dyld_get_image_header(i)
if header.memory.filetype == UInt32(MH_EXECUTE) {
executableHeader = header
break
}
}
@tyrone-sudeium
tyrone-sudeium / gist:1f8f84a511262e382ccc
Created August 18, 2014 01:21
Kill processes in zsh using the "john is kill" meme.
function command_not_found_handler() {
if [[ "$1" == *"is kill" ]]; then
FULLCMD="$1"
PROC="${FULLCMD/ is kill/}"
sudo killall "${PROC}"
if [ $? -eq 0 ]; then
echo "\"no\""
fi
else
>&2 echo "zsh: command not found: $1"
@tyrone-sudeium
tyrone-sudeium / objective-doge.h
Created January 14, 2014 03:19
such code much oo so cocoa wow
#define such @interface
#define wow @end
#define much @implementation
#define shibe self
#define very super
// Example
such TestClass : NSObject
@tyrone-sudeium
tyrone-sudeium / gist:5583727
Created May 15, 2013 12:42
A spinning disabled overlay, akin to ones you'd find on action bars in MMOs.
//
// SDTimedDisableOverlayView.m
// TimedDisabledAnimation
//
// Created by Tyrone Trevorrow on 15-05-13.
// Copyright (c) 2013 Sudeium. All rights reserved.
//
#import "SDTimedDisableOverlayView.h"