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 / 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 / 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
@samstewart
samstewart / changes_diagnostic_app.md
Last active December 17, 2015 12:29
changes I made to the playhaven diagnostic app

Compatibility with UI Tests for Diagnostic App

I added a contentDescription to the major UI components for the SDK so that my UI tests of DiagnosticApp could discern when the main view was being shown.

Logging Fix

Currently, the SDK allows system log level to override the log level set in code in the Playhaven SDK. The idea is to allow support developers to "turn on" the verbose logs when debugging an app that is "mute" in production and the flag can be set via adb setprop log.tag.[APP NAME] [LOG LEVEL]. Unfortunately, this flag defaults to INFO even if the support developer never calls setprop. This means that the code level setting can never restrict the logs below a level of INFO because the device setting takes precedence.

The system property concept as a whole seemed problematic and unreliable so I switched to a small configuration file placed in /sdcard/loglevel.prop that simply listed the appropriate log level. If this file does not exist, the SDK defaults to the code level setting but

@samstewart
samstewart / dump_dom.js
Created May 28, 2013 04:22
Nice script to dump all the visible elements of the DOM to JSON.
/* Dump the DOM as a javascript object in the new window.
Possibly useful links:
https://developer.mozilla.org/en-US/docs/Web/API/document.elementFromPoint
*/
function dump_dom ()
{