Skip to content

Instantly share code, notes, and snippets.

apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools
defaultConfig {
applicationId "samples.linhtruong.com.ui_reactive_rxjava_realm"
minSdkVersion versions.minSdk
@aallan
aallan / speedtest-ifttt.sh
Last active May 29, 2022 15:50
Modified version of Henrik Bengtsson's speedtest-cli code which will dispatch the test results to the IFTTT Maker Channel.
#!/usr/bin/env bash
###########################################################################
# Originally written by: Henrik Bengtsson, 2014
# https://github.com/HenrikBengtsson/speedtest-cli-extras
# Modified to use IFTTT by: Alasdair Allan, 2015
# License: GPL (>= 2.1) [http://www.gnu.org/licenses/gpl.html]
###########################################################################
# Character for separating values
# (commas are not safe, because some servers return speeds with commas)
@asev
asev / bitbucket_load_all_diffs.js
Created July 14, 2015 05:43
Bitbucket load all diffs in pull request
/* Add this line to bookmarks and use when you see
* "Oops! You've got a lot of code in this diff and it couldn't load with the page."
* on a pull request at Bitbucket.
*/
javascript:(function(){[].forEach.call(document.querySelectorAll(".load-diff"),function(a){a.click()})})();
@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active November 16, 2023 15:11
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@degliwe
degliwe / 0_Add some depth to your WatchFace.gif
Last active February 17, 2017 15:01
Add some depth to your WatchFace
0_Add some depth to your WatchFace.gif
@gabrielemariotti
gabrielemariotti / MainActivity.java
Last active February 15, 2021 17:32
How to obtain a CardView (support library) with a Image and rounded corners for API<21
ImageView imageView = (ImageView) findViewById(R.id.card_thumbnail_image);
Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.rose);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
//Default
imageView.setBackgroundResource(R.drawable.rose);
} else {
//RoundCorners
RoundCornersDrawable round = new RoundCornersDrawable(mBitmap,
getResources().getDimension(R.dimen.cardview_default_radius), 0); //or your custom radius
@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:

@JakeWharton
JakeWharton / AutoGson.java
Last active November 28, 2021 12:32
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
import com.google.auto.value.AutoValue;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>
@ignasi
ignasi / resizer-xxhdpi.sh
Last active February 7, 2021 15:29
Android XXHDPI Resizer (Tested on OS X Mavericks)
#!/bin/bash
f=$(pwd)
mkdir drawable-mdpi drawable-hdpi drawable-xhdpi drawable-xxhdpi
# fake argv and argc in bash
argc=$#; argv[0]=$0 # argv[0] is a prog name
for foo in $( seq $argc )
do
@romannurik
romannurik / SwipeDismissListViewTouchListener.java
Last active May 1, 2021 10:16
**BETA** Android 4.0-style "Swipe to Dismiss" sample code
Moved to
https://github.com/romannurik/android-swipetodismiss