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 / AViewController.h
Created April 23, 2017 04:10 — forked from andrassomogyi/AViewController.h
SFSafariViewController Objective-C example
#import <UIKit/UIKit.h>
@import SafariServices;
@interface AViewController : UIViewController
//
// ...
//
@end
@CreatureSurvive
CreatureSurvive / gist:fd2f63c6909ddc1b7c7a70db6c5305a0
Created June 22, 2017 23:18 — forked from bteapot/gist:31192edbc6de7f2ce5d4
UITableView expandable animated rows
#pragma mark - BTDurableView
@interface BTDurableView : UIView
@end
@implementation BTDurableView
//
NSString *html = @"<div style='font: 18pt Helvetica-Light; color: #3498DB;'>Blue Text<span style='color: #AAAAAA;'>GreyText</span></div>"];
NSData *htmlData = [html dataUsingEncoding:NSUTF8StringEncoding];
NSMutableAttributedString *htmlAttributedString = [[NSMutableAttributedString alloc] initWithData:htmlData options:@{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType} documentAttributes:nil error:nil];
[label setAttributedText:htmlAttributedString];
@CreatureSurvive
CreatureSurvive / UILabel+UtilityAttributes.h
Created June 24, 2017 17:29 — forked from PauloMigAlmeida/UILabel+UtilityAttributes.h
UILabel Util Categories for day-to-day use
//
// UILabel+UtilityAttributes.h
//
// Created by Paulo Almeida on 1/31/14.
//
#import <UIKit/UIKit.h>
@interface UILabel (UtilityAttributes)
@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
*
@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 / FileLogging.h
Created May 19, 2019 02:23 — forked from DGh0st/FileLogging.h
Log to a custom file, can be used to get logs from users with a debug build.
#ifndef FILELOGGING
#define FILELOGGING
#ifndef DEBUG
#define FLOG(args...)
#else
#define kLOGFILEPATH @"/path/to/log/file.log"
void _FLog(const char *functionName, int lineNumber, NSString *msgFormat, ...) {
va_list ap;