Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Madsen armadsen

View GitHub Profile
@armadsen
armadsen / openssl-build.sh
Last active Dec 8, 2020 — forked from Norod/openssl-build.sh
A shell script to build openssl for iOS and Mac. >>>>> It currently builds: Mac (i386, x86_64) >>>>> iOS (armv7, arm64) >>>>> iOS Simulator (i386, x86_64) >>>>> Updated to work with Xcode 7 and produce bitcode enabled binaries >>>>> Minimum deployment target can be easily configured
View openssl-build.sh
#!/bin/bash
# This script builds the iOS and Mac openSSL libraries with Bitcode enabled
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# Peter Steinberger, PSPDFKit GmbH, @steipete.
# Doron Adler, GlideTalk, @Norod78
@armadsen
armadsen / FunctionPointerFromMethod.m
Created May 19, 2012
Simple example of getting a function pointer to an Objective-C method and calling it
View FunctionPointerFromMethod.m
// To compile and test this from the command line:
//
// $> clang FunctionPointerFromMethod.m -ObjC -framework Foundation -fobjc-arc
// $> ./a.out
#import <Foundation/Foundation.h>
@interface MyClass : NSObject
- (void)someMethodThatTakesOneStringArgument:(NSString *)string;
@end
@armadsen
armadsen / 2019_apps_using_swift.csv
Created Feb 17, 2019
Data generated by analysis of the top 110 iOS apps as of January 15, 2019
View 2019_apps_using_swift.csv
app_name bundle_id sdk deployment_target uses_swift percentage_swift main_binary_uses_swift is_game executable
30 Day Fitness com.vigorapps.30DayFitness iphoneos12.0 10 TRUE 31% TRUE FALSE ThirtyDaysFitness
8 Ball Pool com.miniclip.8ballpoolmult iphoneos11.3 8 FALSE 0% FALSE TRUE pool
Amazon com.amazon.Amazon iphoneos11.4 9 FALSE 0% FALSE FALSE Amazon
Amazon Alexa com.amazon.echo iphoneos11.2 10 TRUE 28% TRUE FALSE AlexaMobileiOS-prod
Astro Palmistry & Horoscope com.gfb.horoscope iphoneos12.1 8 FALSE 0% FALSE FALSE horoscope
Ball Blast com.nomonkeys.ball-blast iphoneos12.1 9 FALSE 0% FALSE TRUE ball-blast
BetterMen com.betterme.bettermen iphoneos12.0 10 TRUE 74% TRUE FALSE BetterMen
BitLife com.wtfapps.apollo16 iphoneos12.1 8 FALSE 0% FALSE TRUE Apollo16
Bitmoji com.bitstrips.imoji iphoneos11.4 10 TRUE 20% TRUE FALSE imoji
@armadsen
armadsen / LabelDimensions.csv
Created Mar 4, 2013
CSV file containing dimensions information for various Avery label sheets.
View LabelDimensions.csv
labelTypeName labelSheetWidth labelSheetHeight topMargin bottomMargin leftMargin rightMargin numberOfRows numberOfColumns horizontalGutter verticalGutter
Avery 2160 Bottom 8.5 11 5.5 0.5 0.81 0.81 4 1 0 0
Avery 2160 Top 8.5 11 0.5 5.5 0.81 0.81 4 1 0 0
Avery 2162 Bottom 8.5 11 5.5 0.5 0.125 0.125 3 1 0 0
Avery 2162 Top 8.5 11 0.5 5.5 0.125 0.125 3 1 0 0
Avery 2163 Bottom 8.5 11 5.5 0.5 0.125 0.125 2 1 0 0
Avery 2163 Top 8.5 11 0.5 5.5 0.125 0.125 2 1 0 0
Avery 2164 Bottom 8.5 11 5.844 0.844 0.125 0.125 1 1 0 0
Avery 2164 Top 8.5 11 0.844 5.844 0.125 0.125 1 1 0 0
Avery 5159 8.5 11 0.25 0.25 0.156 0.156 7 2 0.188 0
@armadsen
armadsen / UploadBuild.sh
Created Jul 5, 2016
Simple script for creating a zip and DMG, uploading to S3, and posting a new build to an Appcaster instance.
View UploadBuild.sh
#!/bin/sh
# UploadBuild.sh
# Aether
#
# Created by Andrew Madsen on 11/7/15.
# Copyright © 2015 Open Reel Software. All rights reserved.
S3BucketName=<redacted>
username="<redacted>"
@armadsen
armadsen / SceneKitCheatSheet.m
Last active Nov 24, 2019
Cheat sheet for SceneKit learning app (Objective-C)
View SceneKitCheatSheet.m
// Configure the Scene View
self.sceneView.backgroundColor = [UIColor darkGrayColor];
// Create the scene
SCNScene *scene = [SCNScene scene];
@armadsen
armadsen / analyze_apps.py
Created Feb 15, 2019
Script to analyze Swift usage in iOS or Mac apps
View analyze_apps.py
from pathlib import Path
import plistlib
import subprocess
import re
import csv
def app_uses_swift(path):
libswiftPath = path / 'Frameworks' / 'libswiftCore.dylib'
return libswiftPath.exists()
@armadsen
armadsen / MIKMIDISequence+BarBeatTime.m
Created Jul 1, 2016
Quick (untested) example of getting bar-beat time for a particular timestamp in an MIKMIDISequence.
View MIKMIDISequence+BarBeatTime.m
@interface MIKMIDISequence (BarBeatTime)
- (CABarBeatTime)barBeatTimeForTimeStamp:(MusicTimeStamp)timeStamp error:(NSError **)error;
@end
@implementation MIKMIDISequence (BarBeatTime)
- (CABarBeatTime)barBeatTimeForTimeStamp:(MusicTimeStamp)timeStamp error:(NSError **)error
{
error = error ?: &(NSError *__autoreleasing){ nil };
UInt32 timeResolution = 0;
@armadsen
armadsen / ORSSerialPort+Attributes.m
Last active Jul 11, 2018
Example code to get USB device properties for a given instance of ORSSerialPort. Will only work for USB-to-serial adapters, not internal serial ports. Based on https://gist.github.com/rhwood/4124251.
View ORSSerialPort+Attributes.m
#import <Foundation/Foundation.h>
#import <IOKit/usb/USBSpec.h>
#import "ORSSerialPort.h"
@interface ORSSerialPort (Attributes)
@property (nonatomic, readonly) NSDictionary *ioDeviceAttributes;
@property (nonatomic, readonly) NSNumber *vendorID;
@property (nonatomic, readonly) NSNumber *productID;
@armadsen
armadsen / SceneKitCheatSheet.swift
Created Nov 2, 2015
Cheat sheet for SceneKit learning app (Swift)
View SceneKitCheatSheet.swift
// Configure the Scene View
self.sceneView.backgroundColor = .darkGrayColor()
// Create the scene
let scene = SCNScene()