Skip to content

Instantly share code, notes, and snippets.

View andreyugolnik's full-sized avatar

Andrey A. Ugolnik andreyugolnik

View GitHub Profile
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active July 6, 2024 16:28
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@Daij-Djan
Daij-Djan / main.mm
Last active February 2, 2018 10:29
universal main.m for iOS and OSX with or without ARC. It checks the info.plist and invokes apple's native `UIApplicationMain` or `NSApplicationMain` with the right parameters in any case. (See Comment for more info)
//
// main.m
//
// Created by Dominik Pich on 10.02.13.
// Everybody is free to use this however they want!
//
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
@dim13
dim13 / try.c
Created August 9, 2019 12:28
try/catch in plain c
#include <err.h>
#include <stdio.h>
#include <setjmp.h>
#include <signal.h>
static sigjmp_buf exception;
#define try if (!sigsetjmp(exception, 1))
#define catch else
#define throw siglongjmp(exception, 1)