Skip to content

Instantly share code, notes, and snippets.

View amadeu01's full-sized avatar
:octocat:
Working from Stockholm

Amadeu Cavalcante Filho amadeu01

:octocat:
Working from Stockholm
View GitHub Profile
@steveliles
steveliles / Foreground.java
Last active January 22, 2024 18:06
Class for detecting and eventing whether an Android app is currently foreground or background (requires API level 14+)
package com.sjl.util;
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;
@gabrielemariotti
gabrielemariotti / Readme.md
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@kristopherjohnson
kristopherjohnson / NSURLSession_Example.swift
Last active April 10, 2019 00:24
Swift Playground using NSURLSession
import Foundation
import XCPlayground
// Let asynchronous code run
XCPSetExecutionShouldContinueIndefinitely()
if let url = NSURL(string: "http://www.google.com/") {
let session = NSURLSession.sharedSession()
@yesitskev
yesitskev / StethoTree
Last active July 13, 2018 16:06
Stetho Timber Logger
import android.util.Log;
import com.facebook.stetho.inspector.jsonrpc.JsonRpcPeer;
import com.facebook.stetho.inspector.protocol.ChromeDevtoolsMethod;
import org.json.JSONObject;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import timber.log.Timber;
/**
* Log things to console (hacked job).
@espinchi
espinchi / DeviceUtil.java
Last active November 9, 2021 09:36
Check if the running device is an emulator
import android.os.Build;
/**
* Utility methods related to physical devies and emulators.
*/
public class DeviceUtil {
public static boolean isEmulator() {
return Build.FINGERPRINT.startsWith("generic")
|| Build.FINGERPRINT.startsWith("unknown")
@oc2pcoj
oc2pcoj / Good IOS RTSP Player.md
Last active March 11, 2024 02:03
iOS RTSP player for IP video cameras
@daicham
daicham / .gitlab-ci.yml
Last active May 3, 2023 07:05
A sample of .gitlab-ci.yml for a gradle project
image: java:8-jdk
stages:
- build
- test
- deploy
before_script:
# - echo `pwd` # debug
# - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug
@harmittaa
harmittaa / .travis.yml
Last active November 22, 2020 05:38
Example .travis.yml file for Android
# Tutorial here: https://medium.com/@harmittaa/travis-ci-android-example-357f6e632fc4
language: android
sudo: required
jdk: oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
@alouanemed
alouanemed / ApiService.java
Last active October 12, 2018 23:23
takeUntil implementation
@GET(ApiConstants.GET_QUESTIONS_URL) Observable<RequestResponse> getQuestions();
@stefangordon
stefangordon / mjpegexample.js
Created December 21, 2016 16:13
React Native MJPEG
var styles = StyleSheet.create({
backgroundVideo: {
width:400,
height:322
}
})
return (
<View>
<WebView