Skip to content

Instantly share code, notes, and snippets.

View samstewart's full-sized avatar

Sam Stewart samstewart

  • New York, New York
View GitHub Profile
@samstewart
samstewart / uuid-fixes.md
Created September 2, 2011 00:04
iOS 5 UUID Possible Replacements

###UUID Possible Replacements

  • Open UUID
  • Mac Address
    • Privacy concerns? (Perhaps just do MD5 hash)
  • UIPasteboard
    • Bit "hacky" and possibly unreliable
    • Should be relatively solid however, still looking.
  • iCloud
@samstewart
samstewart / wu_iphone_distro.md
Created September 5, 2011 03:14
Description of Willamette University's build process for iPhone apps

Summary

The purpose of this document to explain the various steps, accounts, etc., involved in building "beta" apps and distribution ready apps. This information is only relevant to Willamette University's iPhone Development team though the Apple provisioning process section may be some use in general.

Accounts

Currently, we have three separate accounts which may be the source of some confusion. See Steve Rhine for

  1. TestFlight Account
  2. University Apple Developer Account
  3. Steve Rhine Apple Developer Account
@samstewart
samstewart / ph_image_naming_conventions.md
Created September 8, 2011 20:59
description of image naming convention for content templates

###Image URL Specification Simple url spec for supply image icons of varying resolutions sizes. The goal is to reduce the size of the JSON so we operate on conventions.

####The server's role The server should respond to each variation of the URL. If it doesn't support a particular resolution is should simply return the closet approximation. The server should provide the base image name in the "image" key in the context for each item.

###The client's role The client (mobile javascript) is responsible for loading the appropriate icons based on orientation, resolution, etc. In the interest of speed, the images should be downloaded on-demand and only when needed. Since both server and client agree on conventions, we can request different size images based on the spec outlined here.

####Image Naming Conventions

@samstewart
samstewart / min_max_list.py
Created November 13, 2011 22:39
Find the index of a maximum or minimum element of a python list
#Gets the index of maximum element in a list. If a conflict occurs, the index of the last largest is returned
def maxl(l): return l.index(reduce(lambda x,y: max(x,y), l))
#Gets the index of minimum element in a list. If a conflict occurs, the index of the last smallest is returned
def minl(l): return l.index(reduce(lambda x,y: min(x,y), l))
#same as above but without the reduce coolness
def maxl(l): return l.index(max(l))
def minl(l): return l.index(min(l))
@samstewart
samstewart / osx_ios_hgignore
Created December 9, 2011 02:33
.hgignore file for Mac OS X and iOS applicaitons
syntax: glob
build
*.swp
*.mode1
*.mode1v3
*.mode2
*.mode2v3
*.pbxuser
*.perspective
@samstewart
samstewart / macos_x_ios_gitignore
Created December 9, 2011 02:34
.gitignore file for Mac OS X and iOS applications
# Exclude the build directory
build/*
# Exclude temp nibs and swap files
*~.nib
*.swp
# Exclude OS X folder attributes
.DS_Store
@samstewart
samstewart / annoying_bug
Created May 10, 2012 01:20
Paste from odd bug in Unity framework for Android
05-09 17:22:44.539 24771 24771 I [Playhaven-1.10.2]: Parsing initial content request: true
05-09 17:22:44.539 24771 24771 D PlayHavenFacade: willDisplayContent
05-09 17:22:44.539 24771 24771 D PhoneWindow: couldn't save which view has focus because the focused view com.unity3d.player.UnityPlayer$17@405664f0 has no id.
05-09 17:22:44.539 24771 24771 D Unity : NativeActivity save instance state: 0x2c6910
05-09 17:22:44.539 24771 24771 D Unity : NativeActivity pause: 0x2c6910
05-09 17:22:44.539 505 737 I ActivityManager: Starting: Intent { cmp=com.bitwisedesign.pong2012/com.playhaven.src.publishersdk.content.PHContentView } from pid 24771
05-09 17:22:45.039 505 520 W ActivityManager: Activity pause timeout for HistoryRecord{405a1100 com.bitwisedesign.pong2012/com.unity3d.player.UnityPlayerNativeActivity}
05-09 17:22:45.062 505 520 D MotDevicePolicyManagerService: isPasswordSetEnforced false
05-09 17:22:45.078 24771 24771 I Unity : onPause
05-09 17:22:45.226 505 794 D MotDevicePolicyManagerS
@samstewart
samstewart / glu_null_fix.java
Created May 27, 2012 01:03
Fix for Glu's crashes
// Fix for PHPublisherContentRequest null pointer exception in Playhaven's SDK. Open up PHPublisherContentRequest and find handleRequestSuccess (should be around line 332). Remove the following line:
delegate.requestFailed(this, new JSONException("Couldn't parse respone into PHContent"));
// and replace it with to guard against null delegates
if (delegate != null) delegate.requestFailed(this, new JSONException("Couldn't parse respone into PHContent"));
// if you want extra security, make sure to use a "dummy" delegate as well with blank method stubs instead of passing null.
@samstewart
samstewart / telephone_digitis.py
Created July 17, 2012 18:24
Solution for combinatorics problem
# simple python script for cs106b assignment
import subprocess
words = list()
SYSTEM_DICT_LOOKUP = "egrep -i \"^%s\" /usr/share/dict/words"
class Lexicon:
def __init__(self):
self.word_dict = {}
@samstewart
samstewart / gist:5588542
Created May 16, 2013 00:27
Way to start diagnostic app for playhaven
mvn -Dmaven.test.skip=true -am -pl diagnostic install android:deploy