Skip to content

Instantly share code, notes, and snippets.

View atiffarrukh's full-sized avatar

Atif Farrukh atiffarrukh

View GitHub Profile
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@devunwired
devunwired / GifDecoder.java
Last active January 26, 2024 21:14
An optimized implementation of GifDecoder for Android devices.
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@asifmujteba
asifmujteba / ASFUriHelper
Created April 22, 2015 06:31
Get Real Path from Uri
@TargetApi(Build.VERSION_CODES.KITKAT)
public static String getPath(final Context context, final Uri uri) {
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
// DocumentProvider
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
if (isExternalStorageDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
@pocmo
pocmo / permissions-lollipop.txt
Last active December 8, 2016 14:28
Android Lollipop - Permissions + Groups + Protection Level
(android.permission-group.MESSAGES) android.permission.SEND_SMS dangerous
(android.permission-group.MESSAGES) android.permission.SEND_RESPOND_VIA_MESSAGE <unknown>
(android.permission-group.MESSAGES) android.permission.RECEIVE_SMS dangerous
(android.permission-group.MESSAGES) android.permission.RECEIVE_MMS dangerous
(android.permission-group.MESSAGES) android.permission.CARRIER_FILTER_SMS <unknown>
(android.permission-group.MESSAGES) android.permission.RECEIVE_EMERGENCY_BROADCAST <unknown>
(android.permission-group.MESSAGES) android.permission.READ_CELL_BROADCASTS dangerous
(android.permission-group.MESSAGES) android.permission.READ_SMS dangerous
@FireZenk
FireZenk / RxSocketConnection.java
Created December 21, 2016 12:51
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 {