Skip to content

Instantly share code, notes, and snippets.

View pedrovgs's full-sized avatar
😃

Pedro Gómez pedrovgs

😃
View GitHub Profile
@pedrovgs
pedrovgs / FooterAdapteeCollection.java
Created October 16, 2015 09:17
How to use footers and headers with Renderers
import com.pedrogomez.renderers.ListAdapteeCollection;
public class FooterAdapteeCollection<T> extends ListAdapteeCollection<T> {
private boolean showFooter;
public void showFooter() {
this.showFooter = true;
}
@pedrovgs
pedrovgs / LoadMoreDetector.java
Created July 30, 2015 15:08
Utility class to implement a load more feature using a RecyclerView widget.
/*
* Copyright (C) 2015 Karumi.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@pedrovgs
pedrovgs / FindingTheRightTriangle.md
Created December 27, 2016 16:40
Kata: Finding the right triangle

Find every right triangle that fits all of these conditions:

  • The lengths of the three sides are all integers.
  • The length of each side is less than or equal to a 10.
  • The triangle's perimeter (the sum of the side lengths) is equal to 24.
@pedrovgs
pedrovgs / wrapFunction.scala
Created June 11, 2017 17:11
Declaration of a wrap function using Scala.
type Text = Option[String]
case class ColumnWidth(width: Int)
sealed trait WrapError
case class InvalidText(text: Text) extends WrapError
case class InvalidColumnWidth(width: ColumnWidth) extends WrapError
def wrap(text: Text, width: ColumnWidth): Either[WrapError, Text] = ???

DevEGOpers

Llevo unos años trabajando en empresas del sector tecnológico, me dedico al desarrollo de software y creedme cuando os digo que he visto de todo. Empresas, grandes, empresas pequeñas, auto financiadas, con inversión externa, con equipos técnicos brillantes y equipos técnicos como los que puedes encontrar en cualquier otro lugar. Al igual que empresas de todos los colores también he tenido el placer de conocer a todo tipo de programadores y es ahora que ya han pasado unos cuantos años cuando puedo reconocer una serie de patrones que he visto tanto en mi mismo como en la gente que me rodea. En este gist/post voy a intentar plasmar algunos de estos patrones que he me resultan cuanto menos curiosos.

En este post me centraré en los desarrolladores de software porque es el gremio en el que me encuentro, pero seguro que aunque no te dediques a esto podrás encontrar similitudes con tu profesión. Estos son los patrones con los que yo me he econtrado en diferentes empresas y que he podido ver en mi mismo

@pedrovgs
pedrovgs / .travis.yml
Created September 20, 2018 13:27
Android Travis CI config
language: android
android:
components:
- tools
- platform-tools
- build-tools-27.0.3
- android-28
- extra-android-support
- extra-google-m2repository
- extra-android-m2repository
@pedrovgs
pedrovgs / .travis.yml
Created September 20, 2018 13:28
iOS simple Travis CI configuration
language: objective-c
osx_image: xcode9.4
before_install:
- gem install cocoapods
- pod repo update --silent
- gem install xcpretty
script:
- set -o pipefail && xcodebuild -workspace KataLogInLogOutSwift.xcworkspace -scheme 'KataLogInLogOutSwift' -destination 'platform=iOS Simulator,name=iPhone 6s Plus' build test CODE_SIGN_IDENTITY=- | xcpretty -c
@pedrovgs
pedrovgs / .travis.yml
Created September 20, 2018 13:28
iOS simple Travis CI configuration
language: objective-c
osx_image: xcode9.4
before_install:
- gem install cocoapods
- pod repo update --silent
- gem install xcpretty
script:
- set -o pipefail && xcodebuild -workspace KataLogInLogOutSwift.xcworkspace -scheme 'KataLogInLogOutSwift' -destination 'platform=iOS Simulator,name=iPhone 6s Plus' build test CODE_SIGN_IDENTITY=- | xcpretty -c
@pedrovgs
pedrovgs / FormValidationKata.md
Created March 30, 2019 16:36
Form validation kata statement

Most of our tasks as software engineers are related to forms. Sign up forms, sing in forms, onboarding forms, etc. So today we are going to practice how to validate any form data using accumulative errors so we can now in just one method invocation what are the errors our form contains.

Our task for today's practice is to write a program to be able to validate if the data contained in a form with the following information is valid or not.

  • First name: It can't be empty.
  • Lst name: It can't be empty.
  • Birthdate. It has to be, at least, 18 years old.
  • Document ID: A value containing eight digits and one letter.
  • Phone number: Any combination of 9 numbers.
  • Email: Any valid email.
@pedrovgs
pedrovgs / FlipperInterceptor.java
Created April 4, 2019 07:34
OkHttp version 1 client interceptor for Flipper
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.network.NetworkReporter;
import com.squareup.okhttp.*;
import okio.Buffer;
import okio.BufferedSource;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.ArrayList;