Skip to content

Instantly share code, notes, and snippets.

View pratikbutani's full-sized avatar
🎯
Exploring things

Pratik Butani pratikbutani

🎯
Exploring things
View GitHub Profile
@pratikbutani
pratikbutani / DividerItemDecoration.java
Last active October 2, 2015 05:49
RecyclerView.ItemDecoration simple implementation with DividerItemDecoration
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
@pratikbutani
pratikbutani / colors.xml
Created September 12, 2016 08:14
Material Design Color Palette Colors.xml Resource file for Android
<?xml version="1.0" encoding="utf-8"?>
<!--
Google Material Design Color Palette for Android http://www.google.com/design/spec/style/color.html#color-ui-color-palette
Spreadsheet used to create this reosurce - http://bit.ly/mdcolor_spreadsheet
Link to this colors.xml resource file - http://bit.ly/mdcolorsxml
Harshad Kale
https://github.com/kalehv
harshad.kale@gmail.com
@pratikbutani
pratikbutani / NetworkUtils.java
Last active May 3, 2017 12:29
NetworkUtils is useful to check the internet connection and it will be called when internet connection goes on/off using BroadcaseReceiver.
/**
* @author Pratik Butani
*/
public class NetworkUtils extends BroadcastReceiver {
/**
* Context Variable
*/
Context context;
@pratikbutani
pratikbutani / BaseActivity.java
Last active February 26, 2019 09:33
Common Activity for all Activities (using DataBinding)
public abstract class BaseActivity extends AppCompatActivity {
/**
* DataBinding Object
*/
private ViewDataBinding mBindingObject;
/**
* Context common
*/
@pratikbutani
pratikbutani / BaseFragment.java
Created February 26, 2019 09:36
Common Fragment for all Fragments (using DataBinding)
public abstract class BaseFragment extends Fragment {
/**
* DataBinding Object
*/
private ViewDataBinding mBindingObject;
/**
* Context common
*/
@pratikbutani
pratikbutani / LocationHelperActivity.java
Created June 14, 2019 13:07
Location Helper Activity to get continuously updates of location in your child activity. Just extend this activity in your every child activity where you want to get updates.
public abstract class LocationHelperActivity extends AppCompatActivity {
private static final String TAG = "LocationHelperActivity";
private static final int PERMISSION_REQUEST_CODE = 200;
public static final long INTERVAL = 1000 * 3 * 60; // 3 = 3 minutes
public static final long FASTEST_INTERVAL = 1000 * 60; // 60 = 60 seconds = 1 minutes
public String mCurrentLatitude = "";
public String mCurrentLongitude = "";
@pratikbutani
pratikbutani / README.md
Last active October 5, 2019 06:39 — forked from roachhd/README.md
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

@pratikbutani
pratikbutani / main.dart
Created February 22, 2021 05:31 — forked from filiph/main.dart
Human Life Counter
// This now lives in https://github.com/filiph/human-life/blob/main/lib/main.dart as source
// and at https://filiph.github.io/human-life/ as an app.
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(HumanLifeApp());
}
@pratikbutani
pratikbutani / main.dart
Created April 3, 2021 12:49
Flutter onChange of TextField getting call on keyboard hide (via back press)
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@pratikbutani
pratikbutani / send_firebase_notification.php
Created October 24, 2018 11:50
Send Firebase Notification to more than 1000 users at a time from PHP
<?php
/**
* Created By : Pratik Butani
* Created Date : 24/10/2018
*/
// Database Connection
include "conn.php";
// Get Records from Table
$sql = "SELECT * from fcm";