Skip to content

Instantly share code, notes, and snippets.

@keith
keith / testflight.sh
Last active November 1, 2023 12:59
Upload an ipa to testflight using altool
#!/bin/bash
set -euo pipefail
xcrun altool --upload-app --type ios --file "path/to/foo.ipa" --username "$ITC_USER" --password "$ITC_PASSWORD"
@drewmccormack
drewmccormack / jiggle-wifi.sh
Last active March 13, 2021 20:27
Keeps your OS X WiFi connected to the interwebs.
#!/usr/bin/env bash
# If your OS X WiFi connection stops working, but can be fixed by
# toggling WiFi off and then on, this script can help prevent mouse arm.
# Pings Apple's server repeatedly, toggling WiFi off/on when a connection times out.
while true ; do
curl --head --silent --connect-timeout 10 http://www.apple.com/my-wifi-keeps-dropping-out > /dev/null
if [ $? -ne 0 ] ; then
networksetup -setairportpower en1 off
networksetup -setairportpower en1 on
// Fibonnaci Pandas
let terms = 10
func fib(n:Int) -> Int {
if n == 0 || n == 1 {
return n
} else {
return fib(n-1) + fib(n-2)
}
@steventroughtonsmith
steventroughtonsmith / HWKViewController.m
Last active May 31, 2020 23:55
Example of dynamic iOS UI that changes based on the connection/disconnection of a hardware keyboard, based on suggestions from @JohnRHeaton. Requires linking to private GraphicsServices framework. rdar://problem/15447952
//
// HWKViewController.m
// HardwareKeyboardUI
//
// Created by Steven Troughton-Smith on 13/11/2013.
// Copyright (c) 2013 High Caffeine Content. All rights reserved.
//
#import "HWKViewController.h"
@lukeredpath
lukeredpath / UIAlertView+BlockSupport.h
Created August 14, 2013 08:56
I wanted a block-based API for UIAlertView on my current project, but didn't want to import a whole Pod/library just for that, so I wrote a quick and simple implementation myself. Licensed under the WTFPL license. (http://www.wtfpl.net).
//
// UIAlertView+BlockSupport.h
//
// Created by Luke Redpath on 08/08/2013.
//
#import <UIKit/UIKit.h>
/* Called when the user taps a button in the alert view or the alert
* is cancelled.

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@adamgit
adamgit / gist:3705459
Last active December 11, 2023 16:27
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.82
#
# Latest Change:
# - MORE tweaks to get the iOS 10+ and 9- working
# - Support iOS 10+
# - Corrected typo for iOS 1-10+ (thanks @stuikomma)
@reklis
reklis / makefatlib.sh
Created July 25, 2012 20:46
Make a simulator+device .a file with headers
# http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
TARGET_NAME=<< name of your target or an environment variable >>
CONFIGURATION=Release
DEVICE=iphoneos
SIMULATOR=iphonesimulator
FAT=universal
OUTPUT=build
LIBRARY_NAME=lib${TARGET_NAME}.a
@subdigital
subdigital / ObsidianCode.dvtcolortheme
Created February 21, 2011 20:24
Obsidian Code Theme for Xcode
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>