Skip to content

Instantly share code, notes, and snippets.

import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:redux/redux.dart';
import 'package:chatmetricsproject/models/models.dart' show Login, AppState;
import 'package:chatmetricsproject/widgetutils/widgetutils.dart' show WidgetUtils;
class LoginRequest {
@mkodekar
mkodekar / NetworkModule.kt
Created August 25, 2017 00:10
a crossline function at the end
package co.kodparadise.khabarsamachar.application
import android.content.Context
import co.kodparadise.khabarsamachar.annotations.AppScope
import co.kodparadise.khabarsamachar.dependencies.ContextModule
import com.github.ajalt.timberkt.Timber
import dagger.Module
import dagger.Provides
import okhttp3.Cache
import okhttp3.OkHttpClient
@mkodekar
mkodekar / Functions.kt
Created August 20, 2017 10:28
Various possible functions possible with kotlin
package co.kodparadise.mausam.utils
import android.app.Notification
import android.content.Context
import android.content.SharedPreferences
import co.kodparadise.mausam.R
import com.afollestad.materialdialogs.MaterialDialog
/**
* Created by rkodekar on 8/19/17.
@mkodekar
mkodekar / Functions.kt
Created August 20, 2017 10:27
Various possible functions possible with kotlin
package co.kodparadise.mausam.utils
import android.app.Notification
import android.content.Context
import android.content.SharedPreferences
import co.kodparadise.mausam.R
import com.afollestad.materialdialogs.MaterialDialog
/**
* Created by rkodekar on 8/19/17.
@mkodekar
mkodekar / gist:203b40157bd3e790ecca5a4832ccf051
Created December 14, 2016 08:43 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@mkodekar
mkodekar / gist:a7da00292a6f2b133329f1a607b60368
Created October 19, 2016 21:49 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@mkodekar
mkodekar / RxJava.md
Created September 20, 2016 10:56 — forked from cesarferreira/RxJava.md
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
@mkodekar
mkodekar / LoginActivity.java
Created November 21, 2015 14:01
Registration and login through php and mysql only with volley, fastintent and butterknife.
package com.emagic.newproject;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.net.nsd.NsdManager.RegistrationListener;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
@mkodekar
mkodekar / MainActivity.java
Created November 9, 2015 08:55
Material Drawer with dynamically adding categories to the nav drawer -mike penz method
package com.emagic.newproject;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONStringer;