Skip to content

Instantly share code, notes, and snippets.

View CreatureSurvive's full-sized avatar
:octocat:
melting an ancient GPU in Unity3d

Dana Buehre CreatureSurvive

:octocat:
melting an ancient GPU in Unity3d
View GitHub Profile
@CreatureSurvive
CreatureSurvive / UITextView.m
Created October 26, 2018 01:06 — forked from fethica/UITextView.m
Size-to-Fit Text in UITextView
#define kDefaultFontSize 24.0
myTextView.text = @"Some long string that will be in the UITextView";
myTextView.font = [UIFont systemFontOfSize:kDefaultFontSize];
//setup text resizing check here
if (myTextView.contentSize.height > myTextView.frame.size.height) {
int fontIncrement = 1;
while (myTextView.contentSize.height > myTextView.frame.size.height) {
myTextView.font = [UIFont systemFontOfSize:kDefaultFontSize-fontIncrement];
@CreatureSurvive
CreatureSurvive / noctis_notifications.xm
Last active August 14, 2018 21:04
Am I insane, or should one of these methods be working with NoctisXI
- (void)applicationDidFinishLaunching: (UIApplication *)application {
%orig;
NSLog(@"registering for noctis notifications");
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
// with SEL callbacks
[center addObserver:self selector:@selector(__didRecieveNoctisNotification:) name:@"com.laughingquoll.noctis.enablenotification" object:nil];
[center addObserver:self selector:@selector(__didRecieveNoctisNotification:) name:@"com.laughingquoll.noctis.disablenotification" object:nil];
@CreatureSurvive
CreatureSurvive / OverrideImageInBundle.m
Created July 31, 2018 00:35
return a custom image based on the name of the requested image within a bundle. this should only be used when filtering a specific app in your bundle filter plist
%hook UIImage
// you should not include the file extention or scale in the file name for this to work
// I have not tested this, but it should work for any image being loaded from the bundle
// baseNameOfLaunchscreenImage@2x.png -> baseNameOfLaunchscreenImage
+ (UIImage *)imageNamed: (NSString *)name {
if ([name containsString:@"baseNameOfLaunchscreenImage"]) {
return [UIImage imageWithContentsOfFile:@"/User/Documents/CustomLaunchImage.png"];
}
@CreatureSurvive
CreatureSurvive / CSPListController.h
Last active July 30, 2018 06:45
A simple PSListController Implementation that will display an alert notifying the user if their using a pirated copy of the tweak. Provides an action to add the official source for your tweak, and an action to continue using the pirated version. If the user chooses to continue with the pirated version, the support section of the preferences will…
@interface CSPListController : PSListController
@end
@CreatureSurvive
CreatureSurvive / CSPValueCell.h
Last active July 26, 2018 18:45
Custom PSTableCell for displaying numerical values in a formatted manor, also implements a custom ToolBar for the inputAccessoryView
/**
* @Author: Dana Buehre <creaturesurvive>
* @Date: 11-09-2017 1:22:14
* @Email: dbuehre@me.com
* @Filename: CSPValueCell.h
* @Last modified by: creaturesurvive
* @Last modified time: 16-09-2017 10:45:22
* @Copyright: Copyright © 2014-2017 CreatureSurvive
*/
@CreatureSurvive
CreatureSurvive / CSPVersionCell.h
Created July 23, 2018 14:53
Example of a custom PSTableCell
#import <Preferences/PSTableCell.h>
#import <Preferences/PSSpecifier.h>
@interface CSPVersionCell : PSTableCell
@end
@CreatureSurvive
CreatureSurvive / TerrainStitcher.cs
Created June 16, 2018 19:31
Stitch terrain in unity
class TerrainStitcher extends EditorWindow {
public var terrain1: Terrain = null;
public var terrain2: Terrain = null;
public var options: String[] = ["X", "Z"];
public var index: int = 0;
@MenuItem ("Tools/Terrain stitcher")
static function ShowWindow () {
EditorWindow.GetWindow (TerrainStitcher);
}
@CreatureSurvive
CreatureSurvive / BatchBurner.cs
Created June 16, 2018 17:09 — forked from luciditee/BatchBurner.cs
Batch Burner, a script designed to reduce static mesh draw calls in Unity scenes with a large number of static mesh entities.
/*
* Unity Batch Burner: A script designed to reduce static mesh draw calls automatically in scenes
* with a large amount of static geometry entities.
*
* Copyright 2016-2017 Will Preston & Die-Cast Magic Studios, LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
-(id)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath {
return [self getRowActions:tableView indexPath:indexPath];
}
-(id)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
return [self getRowActions:tableView indexPath:indexPath];
}
-(id)getRowActions:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath {
if (@available(iOS 11, *)) {
UIContextualAction *delete = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive
title:@"DELETE"
@CreatureSurvive
CreatureSurvive / update-repo-cli.sh
Last active September 12, 2023 03:00
a simple cli interface for updating your Cydia repo quickly
# @Author: Dana Buehre <creaturesurvive>
# @Email: support@creaturecoding.com
# @Filename: update-cli.sh
# @Copyright: Copyright © 2014-2018 CreatureCoding
#!/bin/bash
CLEAR='\033[0m'
RED='\033[1;31m'
YELLOW='\033[1;33m'