Skip to content

Instantly share code, notes, and snippets.

View ceeK's full-sized avatar

Chris Howell ceeK

View GitHub Profile
@ceeK
ceeK / AutoBuildable.stencil
Last active March 8, 2018 18:10
AutoBuildable stencil
{#
AutoBuildable let's you create builders for your types. By conforming to AutoBuildable and running sourcery, you get the ability to build your object:
let car = CarBuilder()
.set(wheels: 4)
.set(doors: 5)
.make()
#}// swiftlint:disable file_length, redundant_optional_initialization
{% for type in types.implementing.AutoBuildable|!enum %}
public final class {{type.name}}Builder {
@ceeK
ceeK / autobuildable.swift
Last active March 8, 2018 18:08
AutoBuildable
extension Car: AutoBuildable {}
// run Sourcery
// get this for free! ->
let car = CarBuilder(wheels: 4) // any param without a default value goes into the initializer
.set(color: .red)
.set(hasCruiseControl: true)
.make()
@ceeK
ceeK / freeclass.md
Last active August 29, 2015 14:20
Free classes

##What's needed for simple implementation of free classes:##

  • New flag on OrganisationVenue: trial_class, whether or not the venue has a free class for first time users.

  • Check in bookings for whether the class is a free trial class, and don't charge, can do this either with:

    • Webservice also checks past bookings to see if free class can be given (preferred)
    • New parameter in bookings call trial_class to specify it needs booking for free.
  • Probably a few limitations with this route, but I feel it's fastest to release.

  • Also need image_url on /promotions route.

OrganisationVenue response

The current implementation has us requesting OrganisationVenue's based on the events they run on a day-to-day basis. This means on a Monday, only OrganisationVenue's that have events running that day should be shown.

A typical request is only for one single day, as each day is loaded independently. Parameters:

  • lat
  • lon
  • radius
  • start_time
  • end_time
@ceeK
ceeK / UXtalks.md
Last active August 29, 2015 14:17
UX talks

Top 5 things apps get wrong in UX

Platform conventions

  • People expect things mostly based on using other applications
  • Stick to the platform conventions: i.e. people know what tab bars do, people know what to expect when they swipe left on a tableview that has a list of editable things (delete).

Easy to navigate

  • Tell you where you are (i.e. tab bar, navigation bar title)
  • Show you where else you can go (i.e. tab bar)
  • Explain what's there (don't have to go to each section to see what should be in there)
SELECT
core_events.id AS id,
core_events.name AS name,
core_events.description AS description,
core_events.start_time AS start_time,
core_events.end_time AS end_time,
core_events.price AS price,
core_events.booking_url AS booking_url,
core_events.room AS room,
core_events.availability AS availability,

Priorities for release

  1. Model changes reflecting web service
  2. Facebook Login
  3. Activity spinners throughout the app
  4. New organisation info screen replacing map screen
  5. UX Issues
  6. Skip login
  7. Outstanding bug fixes
@ceeK
ceeK / Facebook_login.md
Last active August 29, 2015 14:16
Social login

Social Login

The Social login flow that we'll be following is as follows (taken from SO):

  1. User opens the app on the phone. Chooses a service with which to authenticate.
  2. Authenticates via one the available services (Facebook, Twitter, foursquare, etc.) and gets some special access token.
  3. Your app takes the token and sends it to your server.
  4. Your server receives the token and validates it. It checks it against the service's API and (at least for Facebook and Twitter) get the corresponding user ID.
  5. Assuming a valid ID, your server checks if user ID has already been used by some user. If so, it logs them in. If the user ID hasn't been created, your server creates its own user record associated with that user ID and logs the user in. In either case, the user ends up logged in and your server issues a session key to your app.
  6. The session key is used for all further communication between your app and your server until the user logs out.
@ceeK
ceeK / March.md
Last active August 29, 2015 14:16

Upcoming

  • Passes
  • Full-text search

Passes

New object FITPass:

  • FITPass defines a month-long pass for an organisation. The pass contains:
  • identifier
  • organisation_id
  • price
[self authenticateUsingOAuthWithURLString:@"/oauth/token"
                                           username:@"engineering@getfitter.co"
                                           password:@"ZapY9mYZrpanZX3cyr8Dk3xjidtGWb"
                                              scope:@""
                                            success:^(AFOAuthCredential *credential) {
                                                NSLog(@"Token: %@", credential.accessToken);
                                                [AFOAuthCredential storeCredential:credential
                                                                    withIdentifier:FITTER_OAUTH_TOKEN];
                                                self.currentUser = nil;