1. The following line is bold
    Hi, I am Bold (**Hi, I am Bold**)

  2. The following line is given emphasis
    I am cooool. (*I am cooool.*)

  3. To write something on the new line, give two spaces and hit enter
    Yay! we are on the next line

  4. Now comes the Headline


regex for finding text with 2 substrings

Ex. 'git' and 'rm'

grep "git.*rm"

// MODE_PRIVATE means created file can only be accessed by the calling application.
// if the preference file ("file name") does not exist by the given name, file will be created.
SharedPreferences sharedPref = context.getSharedPreferences(
"file name", Context.MODE_PRIVATE);
// Use the following if you need to use only one shared preference file for the activity.
SharedPreferences sharedPref = getActivity().getPreferences(Context.MODE_PRIVATE);
// Writing to it
SharedPreferences.Editor editor = sharedPref.edit();
SpannableString ss = new SpannableString("Android is a Software stack");
ClickableSpan clickableSpan = new ClickableSpan() {
public void onClick(View textView) {
startActivity(new Intent(MyActivity.this, NextActivity.class));
// 0 is the start index and 7 is the end index
ss.setSpan(clickableSpan, 0, 7, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// if you are in an activity
LayoutInflater inflater = getLayoutInflater();
// If you have the context
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// or in a cleaner way, from() uses system service interally so its the same inflater
LayoutInflater inflater = LayoutInflater.from(context);
// inflating a view
// if you need to attach the inflated to rootView, returned view will be rootView.
// 3rd parameter is attach_to_root
// starting an activity from another activity
// this is a Activity context
Intent intent = new Intent(this,;
intent.putExtra(Intent.EXTRA_TEXT, "some text");
intent.putExtra("id", 4);
// Receiving intent in AnotherActivity
Bundle extras = getIntent().getExtras();
// this is a context
AlertDialog.Builder builder = new AlertDialog.Builder(this);
// Check other builder methods like setCancelable, setIcon..
builder.setTitle("Set Title");
builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// do something
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
View MyKeyboardBindings.mkd
  • File structure (Navigate to functions, variables of the same class)

    cmd + r

  • Navigate Back to last cursor position

    cmd + [

  • Navigate Forward

    cmd + ]

  • Move Line/Lines up/down

View go_oop4.go
// Taking the same Go example as above
// Human and Student structs ....
human := Human{"John"}
// human will be passed by value, new copy will be created.
student := Student{human, 1}
public class Human {
public String name;
public Human(String name) { = name;
public class Student {
private Human human;