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 / 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 / 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 / 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 / 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