Skip to content

Instantly share code, notes, and snippets.

View 0xstragner's full-sized avatar
👾

Adam Stragner 0xstragner

👾
View GitHub Profile
@jankais3r
jankais3r / iOS 13 Entitlements
Created May 1, 2020 12:46
iOS 13 Entitlements
//Sourced from http://newosxbook.com/ent.jl?ent=&osVer=iOS13
abs-client
absinthe-client
adi-client
allow-obliterate-device
allow-softwareupdated
appData
application-identifier
aps-connection-initiate
aps-environment
@tclementdev
tclementdev / libdispatch-efficiency-tips.md
Last active July 31, 2024 19:06
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

@Adlai-Holler
Adlai-Holler / CATransactionObserving.mm
Last active June 12, 2023 06:23
How to observe CoreAnimation transaction commits as activities. Covers run-loop commits and UIKit-direct-flush commits, but not CADisplayLink scroll view commits.
/**
* Don't use this in production!
*
* Screenshot of it working: https://user-images.githubusercontent.com/2466893/27601666-f65159f0-5b24-11e7-969d-fe86103c21de.png
*/
/**
* This is real, private CA API. Valid as of iOS 10.
*/
typedef enum {
@NSExceptional
NSExceptional / XcodeBuildSettingsReference.md
Last active May 5, 2023 18:57
The Xcode Build Settings Reference in a searchable document, as of Xcode 8.3.2

Build settings reference

Active Build Action (ACTION)

A string identifying the build system action being performed.

Additional SDKs (ADDITIONAL_SDKS)

The locations of any sparse SDKs that should be layered on top of the one specified by Base SDK (SDKROOT). If more than one SDK is listed, the first one has highest precedence. Every SDK specified in this setting should be a "sparse" SDK, for example, not an SDK for an entire macOS release.

Alternate Install Group (ALTERNATE_GROUP)

@traysr
traysr / Shader.fsh
Last active February 22, 2021 14:03
iOS Setup for bookofshaders.com
#ifdef GL_ES
precision mediump float;
#endif
#define TWO_PI 6.28318530718
uniform vec2 u_resolution;
uniform float u_time;
uniform vec2 u_mouse;
@CodaFi
CodaFi / Object.h
Created January 19, 2016 04:54
The headers of the oldest version of the Objective-C runtime I could still find. Extracted from an old NeXT image.
#ident "@(#) Object.h, Rev 2.10, 96/08/02"
//
// Copyright (c) 1995-1996, Sun Microsystems, Inc.
// portions (c) Copyright 1988, 1989 NeXT, Inc.
// All rights reserved.
#ifndef _OBJC_OBJECT_H_
#define _OBJC_OBJECT_H_
#import <objc/objc.h>
@evands
evands / combine_static_libraries.sh
Created January 14, 2015 20:40
Combine multiple .a static libraries, which may each have multiple architectures, into a single static library
#!/bin/sh
# Combined all static libaries in the current directory into a single static library
# It is hardcoded to use the i386, armv7, and armv7s architectures; this can easily be changed via the 'archs' variable at the top
# The script takes a single argument, which is the name of the final, combined library to be created.
#
# For example:
# => combine_static_libraries.sh combined-library
#
# Script by Evan Schoenberg, Regular Rate and Rhythm Software
@IgorMuzyka
IgorMuzyka / GLGlitchEffect.h
Last active December 19, 2017 18:17
Objective-C UIImage Glitch
//
// GLGLitchEffect.h
// Glitch
//
// Created by Igor on 27.08.14.
// Copyright (c) 2014 Igor Muzyka. All rights reserved.
//
#import <Foundation/Foundation.h>
//
// CJCAnonymousFacesFilter.h
// CJC.FaceMaskingDemo
//
// Created by Chris Cavanagh on 11/9/13.
// Copyright (c) 2013 Chris Cavanagh. All rights reserved.
//
#import <CoreImage/CoreImage.h>
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR