Skip to content

Instantly share code, notes, and snippets.

Jorge Garrido FireZenk

Block or report user

Report or block FireZenk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@FireZenk
FireZenk / bot.js
Created Nov 19, 2013
Twitter bot using node.js and twit module to retweet interesting info of node.js
View bot.js
//
// Bot
// class for performing various twitter actions
//
var Twit = require('../lib/twitter');
var Bot = module.exports = function(config) {
this.twit = new Twit(config);
};
@FireZenk
FireZenk / NetworkFragment.java
Created Apr 4, 2014
Android(fragment) abstract class that contains a background thread to handle network connections
View NetworkFragment.java
package com.firezenk.util;
import android.os.AsyncTask;
import android.util.Log;
import com.actionbarsherlock.app.SherlockFragment;
/**
* NetworkFragment Class
* This class extends SherlockFragment and contains one AsyncTask
@FireZenk
FireZenk / SnackbarAnimation.java
Last active Feb 26, 2018
With this class you can clone the {Snackbar} animation to move the {ViewGroup} above of the Snackbar when it is visible and avoid view overlapping (clone of fab animation)
View SnackbarAnimation.java
package com.your.package;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.view.ViewGroup;
import com.daimajia.easing.BaseEasingMethod;
import com.daimajia.easing.Glider;
import com.daimajia.easing.Skill;
import com.nineoldandroids.animation.AnimatorSet;
@FireZenk
FireZenk / MapperUtils.java
Created Oct 30, 2015
Functional programming map-like but in Java
View MapperUtils.java
package com.your.package;
import java.util.ArrayList;
import java.util.List;
/**
* MapperUtils Class
*
* Extracted from Facebook Android API by Jorge Garrido Oval <firezenk@gmail.com>
* Use case:
View SwipeRefreshLayout and StickyListHeaders.md

Trying to find a solution

StickyListHeaders

SwipeRefreshLayout

I had a problem getting the new fancy SwipeRefreshLayout from the appcompat lib to work with a custom listview, in this case the StickyListHeaders. Since the First child of the SwipeRefreshLayout should be either a ScrollView or a pure List, some workaround had to be done.

@FireZenk
FireZenk / Foreground.java
Created Sep 29, 2016
Foreground: listen app's became background or foreground changes
View Foreground.java
package org.firezenk.utils;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import java.util.List;
@FireZenk
FireZenk / demo_data_layer.java
Last active Oct 13, 2016
Demo snippets from the "Clean Architecture: As we have applied in Mr.Milú" slides
View demo_data_layer.java
public class Mediator {
public Observable<Auth> login(Login loginModel) {
if (loginStrategy.isAlreadyLogged())
return Observable.from(authCache);
else
return repository.login(loginMapper.toRequest(loginModel))
.map(entity -> authMapper.fromResponse(entity));
}
}
@FireZenk
FireZenk / RxSocketConnection.java
Created Dec 21, 2016
A working example of reactive implementation of a socket connection using okhttp3 socket api
View RxSocketConnection.java
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
import rx.Observable;
public class RxSocketConnection extends WebSocketListener {
@FireZenk
FireZenk / SchedulerProvider.java
Created Jan 2, 2017
UseCase executor, that takes handle use cases, their possible errors and return the subscription
View SchedulerProvider.java
package com.sample.app.ui.schedulers;
import android.support.annotation.NonNull;
import rx.Scheduler;
/**
* Project: app
*
* Created by Jorge Garrido Oval on 01/12/2016.
@FireZenk
FireZenk / CustomActivity.java
Created May 2, 2017
Synchronizing animations in RecyclerView
View CustomActivity.java
@Bind(R.id.my_recyclerview) RecyclerView myList;
private PublishSubject<Long> animationTimer;
private Subscription animationSubscription;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ButterKnife.bind(this);
animationSubscription = Observable.interval(1, TimeUnit.SECONDS)
You can’t perform that action at this time.