Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Madsen armadsen

View GitHub Profile
@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 / MIKMIDISynthesizer+Volume.swift
Created May 12, 2018
Extension to add a volume property to MIKMIDISynthesizer on iOS
View MIKMIDISynthesizer+Volume.swift
//
// MIKMIDISynthesizer+Volume.swift
//
// Created by Andrew Madsen on 3/22/16.
// Copyright © 2016 Mixed In Key. All rights reserved.
//
import Foundation
import CoreAudio
import MIKMIDI
View MIDIPacketNextTest.m
/* Compile this with:
clang -std=c99 -framework CoreMIDI -fed MIDIPacketNextTest.m
Run:
./a.out
*/
@armadsen
armadsen / CommitSubmodules.sh
Created Jul 19, 2017
Quick and dirty bash script to recursively commit submodules
View CommitSubmodules.sh
if [[ "$#" -ne 1 ]]; then
echo "You must specify a commit message as an argument."
exit 1
fi
COMMIT_MESSAGE="$1"
git submodule foreach "echo 'Adding all files.'; git add ."
git submodule foreach "echo 'Stashing.'; git stash"
git submodule foreach "echo 'Checking out master branch.'; git checkout master"
git submodule foreach "echo 'Applying stash.'; git stash apply"
View brewconfig.txt
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: (none)
HEAD: (none)
Last commit: never
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://ia902307.us.archive.org/31/items/tigerbrew
CPU: single-core 32-bit g4e
@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 / 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 / deletescreen.rb
Last active Jan 28, 2016
Ruby script using spaceship to delete all existing screenshots for an iOS app on iTunes Connect
View deletescreen.rb
#!/usr/bin/env ruby
require "spaceship"
Spaceship.login('yourusername', 'yourpassword')
Spaceship::Tunes.login('yourusername', 'yourpassword')
du = Spaceship::Tunes.client.du_client
app = Spaceship::Tunes::Application.find "app.bundle.id"
@armadsen
armadsen / KVODependentToManyBug.m
Created Nov 5, 2015
Example program attached to Radar #
View KVODependentToManyBug.m
#import <Foundation/Foundation.h>
@interface Foo : NSObject
@property (nonatomic, strong) NSArray *bars;
- (void)addBar:(NSString *)bar;
- (void)removeBar:(NSString *)bar;
@end
You can’t perform that action at this time.