Skip to content

Instantly share code, notes, and snippets.

View rajeefmk's full-sized avatar

RmK rajeefmk

  • Bangalore
View GitHub Profile
@jmarkovic
jmarkovic / PermissionDef.java
Created January 28, 2016 19:34
Android annotation defining all permissions in a StringDef annotation.
/**
* Typedef annotation listing all permissions
* available in the latest SDK.
* Using this on a method parameter
* or on a method with {@link String} return value
* will trigger value lookup in Android Studio.
*
* @version SDK23
* @author jmarkovic
*/
@joshskeen
joshskeen / gist:4fcd3f7ba7d37ee69fee
Created April 22, 2015 03:03
radio button recyclerview
abstract class RadioAdapter<T> extends RecyclerView.Adapter<RadioAdapter.ViewHolder> {
public int mSelectedItem = -1;
private Context mContext;
private List<T> mItems;
public RadioAdapter(Context context, List<T> items) {
mContext = context;
mItems = items;
}
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@itsalif
itsalif / SimpleXmlRequest.java
Last active February 25, 2019 16:03 — forked from ficusk/GsonRequest.java
Volley adapter for making XML Requests. It uses Simple-XML for serializing XML to Objects (http://simple.sourceforge.net/). Code is based of GsonRequest. Hope someone finds it useful.
import java.io.UnsupportedEncodingException;
import java.util.Map;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@sharonbn
sharonbn / SslUtil.java
Last active August 21, 2022 05:48
SSL/TLS connection from Eclipse Paho Java client to mosquitto MQTT broker
import java.io.*;
import java.nio.file.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
import org.bouncycastle.jce.provider.*;
import org.bouncycastle.openssl.*;
public class SslUtil