Skip to content

Instantly share code, notes, and snippets.

View hectorups's full-sized avatar

Hector Monserrate hectorups

  • Affirm
  • San Francisco
View GitHub Profile
enum class AnimatedOnboardingVariant{ CLASSIC, ANIMATED }
object AnimatedOnboarding : ExperimentType<AnimatedOnboardingVariant> {
 override val description = "‍🎬 Animated Onboarding"
 override val name = "animated_onboarding"
 override val defaultVariant = CLASSIC
}
when(experimentation.variantForExperiment(AnimatedOnboarding)) {
 CLASSIC -> {
 // show classic onboarding
 experimentation.trackImpression(AnimatedOnboarding)
 }
 ANIMATED -> {
 // show new animated onboarding
 experimentation.trackImpression(AnimatedOnboarding)
 }
}

Rotten Tomatoes iOS app

caption

  • User can view a list of movies from Rotten Tomatoes. Poster images must be loading asynchronously.
  • User can view movie details by tapping on a cell
  • User sees loading state while waiting for movies API. You can use one of the 3rd party libraries at cocoacontrols.com.
  • User sees error message when there's a networking error. You may not use UIAlertView to display the error. See this screenshot for what the error message should look like: network error screenshot.
Rotten Tomatoes iOS app
=======================
![caption](https://s3-us-west-1.amazonaws.com/samsung-uploads/ios_assignment_week1.gif)
* [x] User can view a list of movies from Rotten Tomatoes. Poster images must be loading asynchronously.
* [x] User can view movie details by tapping on a cell
* [x] User sees loading state while waiting for movies API. You can use one of the 3rd party libraries at cocoacontrols.com.
* [x] User sees error message when there's a networking error. You may not use UIAlertView to display the error. See this screenshot for what the error message should look like: network error screenshot.
@hectorups
hectorups / api interface
Created August 19, 2014 00:27
Retrofit use
public interface Api {
@POST("/users/sign_in") Observable<Response> login(@Body Login login);
}
@hectorups
hectorups / gist:0561b7f184fba7c077a2
Last active August 29, 2015 14:05
Create S3 signature
#!/usr/bin/env ruby
require 'json'
require 'base64'
require 'openssl'
require 'digest/sha1'
aws_access_key = "AKIAJ7YGAAAGKXEVQX2Q"
aws_secret_key = "xxxxxx"
bucket_name = "bucket-name"
s3_directory = ''
@hectorups
hectorups / gist:004f30bdbdb7ad14514b
Last active August 29, 2015 14:05
class to upload to S3
public class AWSClient implements AWSApi {
private final AWSApi awsApi;
@Inject OkHttpClient client;
@Inject ErrorHandler errorHandler;
public AWSClient(final DottieApplication application) {
application.inject(this);
RestAdapter restAdapter = new RestAdapter.Builder().setClient(new OkClient(client))
.setEndpoint(Constants.AWS_ENDPOINT)
.setErrorHandler(errorHandler)
@hectorups
hectorups / gist:10205857
Created April 8, 2014 22:59
google plus problem
def gapi_authorization(code)
# Read in the client secrets
client_secrets = {
temporary_credential_uri: 'https://www.google.com/accounts/OAuthGetRequestToken',
authorization_uri: 'https://accounts.google.com/o/oauth2/auth',
token_credential_uri: 'https://accounts.google.com/o/oauth2/token',
client_id: '711346440759-xxx.apps.googleusercontent.com',
client_secret: 'xxx',
redirect_uris: [ "oob" ]
}