Skip to content

Instantly share code, notes, and snippets.

@schmod
schmod / ExternalInterfaceExample.swf
Created November 2, 2012 21:35
SWFObject ExternalInterface Test
@myaaaaa-chan
myaaaaa-chan / GsonRequest
Created July 4, 2013 05:28
Volley adapter for JSON requests with POST method that will be parsed into Java objects by Gson @see https://gist.github.com/ficusk/5474673
package jp.i_dig.community.util;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
public class NetworkLogUtility {
public static void logFailure(Call call, Throwable throwable){
if(call != null){
if (call.isCanceled())
Timber.e("Request was cancelled");
Request request = call.request();
if(request != null){
HttpUrl httpUrl = request.url();
@prasad091
prasad091 / AccessStorageApi
Created March 29, 2014 10:29
Access Storage In Android KITKAT
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
@robotdad
robotdad / launch.json
Created July 20, 2016 00:00
vscode-arduino-jsons
{
"version": "0.2.0",
"configurations": [
{
"name": "Arduino attach (Windows)",
"type": "cppdbg",
"request": "launch",
"launchOptionType": "Local",
"miDebuggerPath": "C:/Users/mgoodner/AppData/Local/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gdb.exe",
"targetArchitecture": "ARM",
@mgarnerdev
mgarnerdev / PagingRecyclerView
Created December 8, 2015 23:23
Horizontal Snapping RecyclerView with Page Indication
import android.content.Context;
import android.graphics.PointF;
import android.support.v7.widget.LinearSmoothScroller;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.MotionEvent;
/**
@nschwermann
nschwermann / HeaderAdapter
Created December 20, 2014 16:42
RecyclerView HeaderAdapter
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
  • Functional Programming is a model of programming that transform and compose stream of immutable sequences by applying map, filter and reduce. Events are immutable because you can't change history.
  • Reactive Programming is a model of programming focuses on data flow and change propagation.
  • ReactiveX is an API that focuses on asynchronous composition and manipulation of observable streams of data or events by using a combination of the Observer pattern, Iterator pattern, and features of Functional Programming.
  • RxJava is the open-source implementation of ReactiveX in Java.
  • RxJava is a Java VM implementation of ReactiveX (Reactive Extensions): a library for composing asynchronous and event-based programs by using observable sequences.
  • RxAndroid is a lightweight extension to RxJava that providers a Scheduler for Android’s Main Thread, as well as the ability to create a Scheduler that runs on any given Android Handler class.
  • The two main classes are Observable and Subscriber.
  • `O
@voghDev
voghDev / PreferenceHelper.java
Last active June 29, 2020 20:16
Generic Preference Helper to save some lines of code managing shared preferences
/*
* Copyright (C) 2016 Olmo Gallegos Hernández.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@donnfelker
donnfelker / android-19-circle.yml
Last active March 12, 2021 13:19
Sample CircleCI Configuration For an Android App
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/your-app-name/app/build/outputs/apk/
machine:
environment: