Skip to content

Instantly share code, notes, and snippets.

View pedrolaranjeiro's full-sized avatar

Pedro Laranjeiro pedrolaranjeiro

  • Flat 14 Ltd
  • London, UK
View GitHub Profile
BbWhat is your favourite app?
WhatsApp. Allows me to keep in touch with family and friends. And of course, to get all the latest gossip.
Which 3 words would your closest friends use to describe you?
Ambitious, Grumpy, Stubborn,
Which city would you most like to live in?
None, I'm more of a country boy. I’d rather live in a small village near a sandy beach.
What are your 3 favorite "desert island disc" songs?
public String getTimestamp() {
DateTime post = new DateTime(1468973396572);
DateTime now = new DateTime();
Period period = new Period(post, now);
PeriodFormatter formatter;
if(period.getYears() != 0){
formatter = new PeriodFormatterBuilder().appendYears().appendSuffix("Y").printZeroNever().toFormatter();
}else if(period.getMonths() !=0){
@pedrolaranjeiro
pedrolaranjeiro / Adapter
Last active August 29, 2015 14:18
Adaptation of TabPageIndicator to support Centered Icon only tabs
package com.phempto.ui.home.adapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.phempto.ui.home.fragment.BaseFragment;
import com.phempto.ui.home.fragment.HomeFragment;
import com.viewpagerindicator.IconPagerAdapter;