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 / GenericSwipeCallback.kt
Created Apr 26, 2018
Swipe DSL kotlin-android
View GenericSwipeCallback.kt
import android.view.View
abstract class GenericSwipeCallback(
private var swipeLeft: SwipeAction? = null,
private var swipeRight: SwipeAction? = null
) : ItemTouchHelper.Callback() {
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 / TimberExt.kt
Created Mar 29, 2019
Dumps the Android Intent content on Timber
View TimberExt.kt
import android.content.Intent
import timber.log.Timber
fun dumpIntent(intent: Intent) {
val bundle = intent.extras
if (bundle != null) {
val keys = bundle.keySet()
val it = keys.iterator()
Timber.e("------->>> Dumping Intent start")
while (it.hasNext()) {
FireZenk / gzip.kts
Last active Nov 22, 2018 — forked from sgdan/gzip.kts
Kotlin code to compress/uncompress a string with gzip
View gzip.kts
import java.nio.charset.StandardCharsets.UTF_8
fun String.gzip(): ByteArray {
val bos = ByteArrayOutputStream()
GZIPOutputStream(bos).bufferedWriter(UTF_8).use { it.write(this) }
return bos.toByteArray()
FireZenk / TextViewExt.kt
Created Nov 15, 2018
A collection of TexView extension functions (justify fun for now)
View TextViewExt.kt
import android.text.Spanned
import android.text.SpannableString
import android.text.SpannableStringBuilder
import android.widget.TextView
import java.util.concurrent.atomic.AtomicBoolean
fun TextView.justify() {
FireZenk /
Created Dec 21, 2016
A working example of reactive implementation of a socket connection using okhttp3 socket api
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 / ToolbarSearchDsl.kt
Created Apr 26, 2018
Toolbar Search dsl kotlin-android
View ToolbarSearchDsl.kt
import android.view.MenuItem
annotation class ToolbarSearchDsl
FireZenk /
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)
package com.your.package;
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 / WebSocket.kt
Created Jan 11, 2018 rx implementation
View WebSocket.kt
object WebSocket : WebSocketListener() {
private lateinit var broadcaster: FlowableEmitter<String>
private lateinit var disposable: Disposable
private lateinit var webSocket: WebSocket
private val flowable = Flowable.create(FlowableOnSubscribe<String> { emitter -> broadcaster = emitter }, BackpressureStrategy.BUFFER)
fun subscribe(): Flowable<String> {
val client = OkHttpClient.Builder()
.readTimeout(0, TimeUnit.MILLISECONDS)
FireZenk / SignalrSocket.kt
Created Jan 11, 2018
Signalr socket rx implementation
View SignalrSocket.kt
object SignalrSocket {
private lateinit var broadcaster: FlowableEmitter<String>
private lateinit var disposable: Disposable
private val flowable = Flowable.create(FlowableOnSubscribe<String> { emitter -> broadcaster = emitter }, BackpressureStrategy.BUFFER)
private lateinit var mHubConnection: HubConnection
private lateinit var mHubProxy: HubProxy
@Throws(InterruptedException::class, ExecutionException::class)
You can’t perform that action at this time.