Skip to content

Instantly share code, notes, and snippets.

View NSExceptional's full-sized avatar

Tanner Bennett NSExceptional

View GitHub Profile
@steventroughtonsmith
steventroughtonsmith / gist:6763213
Created September 30, 2013 12:39
Non-opaque application windows in iOS 7, with optional blur. Shows the user's wallpaper under the app, with Parallax if supported.
typedef enum _UIBackgroundStyle {
UIBackgroundStyleDefault,
UIBackgroundStyleTransparent,
UIBackgroundStyleLightBlur,
UIBackgroundStyleDarkBlur,
UIBackgroundStyleDarkTranslucent
} UIBackgroundStyle;
@interface UIApplication (UIBackgroundStyle)
-(void)_setBackgroundStyle:(UIBackgroundStyle)style;
@nsdevaraj
nsdevaraj / UserInfo.xml
Last active September 21, 2020 22:18
Load Local XML info in Objective C, get the objects into a Dictionary
<Subjects>
<Subject name='Kannada' user="APPUSERIESKANNADA"/>
<Subject name='The Looney Tunes Show'>
<Topic code="looney" name="Looney" YTTV="true" />
<Topic code="619C868BD457387C" name="Baby Looney Tunes" />
<Topic code="6F2996C1B34A5FC4" name="The Looney Tunes Show" />
<Topic code="738A89379AF8DD2A" name="Bugs Bunny " />
<Topic code="A2C5018B54365C3C" name="Daffy Duck" />
<Topic code="D572048819F3CE24" name="Duck Dodgers" />
<Topic code="82C2B02BE527E534" name="Looney Tunes" />
@arobb
arobb / sierra-virtualbox-install.md
Last active November 24, 2020 13:15
Install macOS Sierra in VirtualBox on macOS host

Step 1 (Creating a bootable macOS Sierra ISO for VirtualBox):

  1. hdiutil attach /Applications/Install\ macOS\ Sierra\ Public\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
  2. hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
  3. hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
  4. asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
  5. rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
  6. cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
  7. cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
@mattt
mattt / UIImageForSwatchOfColorWithSize.h
Created September 27, 2013 01:25
Create a UIImage swatch of a color with a specified size.
static UIImage * UIImageForSwatchOfColorWithSize(UIColor *color, CGSize size) {
UIImage *image = nil;
CGRect rect = CGRectMake(0.0f, 0.0f, size.width, size.height);
UIGraphicsBeginImageContext(rect.size);
{
CGContextRef c = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(c, [color CGColor]);
@cyrfer
cyrfer / git-submodules-tldr.md
Last active May 24, 2021 20:50
git submodule tldr
@markmals
markmals / Combine+concurrency.swift
Last active June 24, 2021 09:05
Extensions to Apple's Combine framework to interoperate with Swift 5.5's new concurrency features
import Combine
extension Publisher {
var stream: AsyncThrowingStream<Output> {
AsyncThrowingStream(Output.self) { continuation in
let cancellable = sink { completion in
switch completion {
case .finished: continuation.finish()
case .failure(let error): continuation.finish(throwing: error)
}
// Similar to defer in Swift
#define pspdf_defer_block_name_with_prefix(prefix, suffix) prefix ## suffix
#define pspdf_defer_block_name(suffix) pspdf_defer_block_name_with_prefix(pspdf_defer_, suffix)
#define pspdf_defer __strong void(^pspdf_defer_block_name(__LINE__))(void) __attribute__((cleanup(pspdf_defer_cleanup_block), unused)) = ^
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
static void pspdf_defer_cleanup_block(__strong void(^*block)(void)) {
(*block)();
}
#pragma clang diagnostic pop
@tom-go
tom-go / install_theos.sh
Created August 13, 2012 16:15
Theos install script
#!/bin/bash
export THEOS=/opt/theos
# clone theos.git
cd /opt
git clone git://github.com/DHowett/theos.git
# clone iphoneheaders.git
cd $THEOS
mv include include.bak
@markmals
markmals / Swift Wish List.md
Last active June 12, 2022 21:10
Features I would like to see from Swift and its core ecosystem

Swift Wish List

Features I would like to see from Swift and its core ecosystem, to make it a robust and ergonomic language for all use cases.

  • ❌ = Unimplemented
  • 📜 = Manifesto
  • ⚾️ = Pitch
  • 💍 = Proposal
  • ⛔️ = Partially Implemented / Awaiting Implementation
  • ⚠️ = In Active Review
@0xced
0xced / Working without a nib.md
Created March 7, 2019 19:02
Working without a nib blog posts by Jeff Johnson (@lapcatsoftware)
  • [Working without a nib, Part 1][1]
  • [Working without a nib, Part 2: Also Also Wik][2]
  • [Working without a nib, Part 5: No, 3!][3]
  • [Working without a nib, Part 4: setAppleMenu][4]
  • [Working without a nib, Part 5: Open Recent menu][5]
  • [Working without a nib, Part 6: Working without a xib][6]
  • [Working without a nib, Part 7: The empire strikes back][7]
  • [Working without a nib, Part 8: The nib awakens][8]
  • [Working without a nib, Part 9: Shipping without a nib][9]
  • [Working without a nib, Part 10: Mac Main Menu][10]