Skip to content

Instantly share code, notes, and snippets.

@pixelomer
pixelomer / appgen
Last active September 4, 2021 16:23
Simple script to create macOS application bundles
#!/usr/bin/env bash
if [[ $1 == "--help" ]] || [[ $1 == "-h" ]]; then
echo "Usage: appgen [--help]"
echo ""
echo "AppGen is a tool for creating macOS Application bundles from the terminal. This is an interactive script and doesn't require any arguments to be passed."
echo ""
echo "+ Application Name: Name of the application. Cannot contain special characters, such as \\, \" and *"
echo "+ Bundle Identifier: The identifier of the application. Usually in the form of \"com.website.appname\" without quotes where com.website is a reversed domain name."
echo "+ Script To Execute: This is a shell script or binary and will be ran when you start your application."
@pixelomer
pixelomer / mkjail.sh
Last active March 13, 2025 09:33
Create a macOS chroot jail with GNU bash and utilities
#!/usr/bin/env sh
#############################################
# WARNING #
# No more commits are going to be made to #
# this gist. Please get the latest script #
# from the new repository: #
# https://github.com/pixelomer/macos-mkjail #
#############################################
@pixelomer
pixelomer / brainfuck_interpreter.c
Last active August 17, 2019 13:11
Really slow brainfuck interpreter with a cool UI
/*-------------------------------------------------*
| The project has been moved to a new repository: |
| https://github.com/pixelomer/VisualBrainfuck |
*-------------------------------------------------*/
@pixelomer
pixelomer / CleanTube.xm
Created September 22, 2019 13:36
Incomplete tweak
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
#define NSLog(args...) NSLog(@"[CleanTube] "args)
static NSString * const reuseIdentifier = @"CleanTubeCell";
@interface YTAsyncCollectionView : UICollectionView<UICollectionViewDataSource>
@property (nonatomic, retain) NSMutableArray<NSIndexPath *> *cleanIndexPaths;
@end
#import <UIKit/UIKit.h>
@interface SpringBoard : UIApplication
- (BOOL)isLocked;
- (id)_accessibilityFrontMostApplication;
@end
static void NVAHVolumeHook(id self, SEL _cmd, id arg1, IMP orig) {
SpringBoard *springboard = (id)UIApplication.sharedApplication;
id frontmostApp = [springboard _accessibilityFrontMostApplication];
- (BOOL)executeQuery:(NSString *)query
parameters:(NSArray<__kindof NSObject *> *)params
block:(BOOL(^)(NSArray<NSString *> *, NSArray *))block
{
sqlite3_stmt *stmt = NULL;
int status = sqlite3_prepare_v2(_databaseHandle, query.UTF8String, -1, &stmt, NULL);
if (status != SQLITE_OK) {
if (stmt) sqlite3_finalize(stmt);
return NO;
}
#!/usr/bin/env python3
# This script creates a message that abuses Janet the Discord
# bot to print a minesweeper field
import json
from sys import stdout
from random import randint
BOMB_CELL = 9
@pixelomer
pixelomer / joycontrol-autocapture.py
Created January 6, 2021 13:26
Script for automatically triggering a video recording on a Switch once every 25 seconds
#!/usr/bin/env python3
import asyncio
import logging
import os
from aioconsole import ainput
from joycontrol import logging_default as log, utils
from joycontrol.command_line_interface import ControllerCLI
@pixelomer
pixelomer / longest-selector-finder.m
Created March 3, 2021 16:28
Small Objective-C program for finding the longest built-in method name
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
static void LoadAllFrameworks(NSString *root) {
NSFileManager *defaultManager = [NSFileManager defaultManager];
NSDirectoryEnumerator *enumerator = [defaultManager
enumeratorAtURL:[NSURL fileURLWithPath:root]
includingPropertiesForKeys:nil
options:NSDirectoryEnumerationSkipsSubdirectoryDescendants
errorHandler:nil
@pixelomer
pixelomer / OSUBeatmap.h
Created March 7, 2021 12:35
osu! beatmap metadata parser written in Objective-C
#import <Foundation/Foundation.h>
NSDictionary *OSUParseBeatmap(NSURL *beatmapURL);