Skip to content

Instantly share code, notes, and snippets.

View eis6aer's full-sized avatar
🏠
Working from home

Javier Torres eis6aer

🏠
Working from home
View GitHub Profile
@eis6aer
eis6aer / SampleCastingPlayerActivity.kt
Created December 12, 2020 05:46 — forked from stefan-zh/SampleCastingPlayerActivity.kt
Create Cast-enabled Activity with ExoPlayer
package com.exoplayer.cast
import android.net.Uri
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.google.android.exoplayer2.Player
import com.google.android.exoplayer2.SimpleExoPlayer
import com.google.android.exoplayer2.ext.cast.CastPlayer
curl -i -H 'Content-type: application/json' -H 'Authorization: key=<your_server_key>' -XPOST https://fcm.googleapis.com/fcm/send -d '{
"registration_ids":["registration_ids", "of the", "target", "devices as array"],
"notification": {
"title":"Title of your notification",
"body":"content of your notification"
},
"data": {
"key1" : "value1",
"key2" : "value2",
"key3" : 23.56565,
@eis6aer
eis6aer / NestedScrollViewLoadMore
Created April 22, 2020 00:16 — forked from IkhwanSI13/NestedScrollViewLoadMore
load more data in NestedScrollView with NotificationListener
import 'package:cartenz_djp/style/colors.dart';
import 'package:cartenz_djp/widget/override/customTabs.dart' as Tabs;
import 'package:flutter/material.dart';
class ExampleWidget extends StatefulWidget {
@override
State<StatefulWidget> createState() => ExampleState();
}
class ExampleState extends State<ExampleWidget> {
@eis6aer
eis6aer / ConcurrencyHelpers.kt
Created October 18, 2019 03:34 — forked from objcode/ConcurrencyHelpers.kt
Helpers to control concurrency for one shot requests using Kotlin coroutines.
import kotlinx.coroutines.CoroutineStart.LAZY
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.async
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.yield
import java.util.concurrent.atomic.AtomicReference
import kotlin.DeprecationLevel.ERROR
@eis6aer
eis6aer / RxJavaExamples.java
Created February 27, 2019 05:08 — forked from ariesmcrae/RxJavaExamples.java
RxJava examples using Java 8 Lambda. Examples include zip, map, take, filter, reduce
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import rx.Observable;
import rx.Observer;
import rx.functions.Func2;
public class RxJavaExamples {
import java.io.UnsupportedEncodingException;
/**
* Utilities for encoding and decoding the Base64 representation of
* binary data. See RFCs <a
* href="http://www.ietf.org/rfc/rfc2045.txt">2045</a> and <a
* href="http://www.ietf.org/rfc/rfc3548.txt">3548</a>.
*/
public class Base64 {