Skip to content

Instantly share code, notes, and snippets.

View gotoark's full-sized avatar
🎯
Focusing

RAJESH KUMAR ARUMUGAM gotoark

🎯
Focusing
View GitHub Profile
@gotoark
gotoark / gist:44a106492699ac3e42af5312576edf54
Created March 13, 2017 03:24 — 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
@gotoark
gotoark / DuplicateEntryInArrayList
Created March 17, 2017 07:16
Find the No of Duplicate Entries in an Array List Using HashMap.
/*
Pass ArrayList as Arugument
*/
public static void findDuplicate(ArrayList<String> arrayList){
//Define Hash Map to Store String Value and its repeatCount
Map<String,Integer> duplicate_counter=new HashMap<String, Integer>();
/*For each String Value in the ArrayList Check Wather it is Available Already in Hash Map
if yes increment the value of a key in hash Map
else just add value as 1
@gotoark
gotoark / DatePicker.java
Last active April 19, 2017 05:00
Simple Date Picker in Android
@RequiresApi(api = Build.VERSION_CODES.N)
public void getDate(){
final Calendar calendar=Calendar.getInstance();
DatePickerDialog.OnDateSetListener dateSetListener=new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
calendar.set(Calendar.YEAR,year);
calendar.set(Calendar.MONTH,month);
@gotoark
gotoark / DynamicText.java
Created April 11, 2017 07:17
Fill the Text in Field Two while typing the Field 1
edittext1.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
edittext2.setText(s);
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
edittext2.setText(s);
}
@gotoark
gotoark / Style_EditText.xml
Created April 26, 2017 06:24
Edit text with Visible Hint
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/edittext_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Your Hint"
@gotoark
gotoark / unity3tutoriallist.md
Created June 9, 2017 10:27 — forked from gersande/unity3tutoriallist.md
Unity Tutorial List for 2D Games
@gotoark
gotoark / README.md
Created July 4, 2017 18:09 — forked from lopspower/README.md
Testing activity in Android Studio

Testing activity in Android Studio

How we build the app

Before we start writing our first UI test I want to describe our development process.

  1. First, we write a test for a UI or logic that does not yet exist.
  2. We expect to see build errors or failed tests.
  3. Then we create a UI element or write program logic.
  4. Finally, we run the test and make sure it passes.
@gotoark
gotoark / DateCompUtil.js
Created July 28, 2017 07:45
DateComparison in Javascript
function Stringtodate(inputDate)
{
var splittedDate = inputDate.split("/");
var date=new Date();
date.setDate(splittedDate[0]);
date.setMonth(splittedDate[1]-1); //in js month range 0-11
date.setFullYear(splittedDate[2]);
return date;
}
@gotoark
gotoark / LeapYear.js
Last active August 10, 2017 09:53
LeapYear.js
function leapYear(year)
{
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}
@gotoark
gotoark / SelectOptionBasedonCustomTag.js
Created August 10, 2017 09:53
SelectOptionBasedonCustomTag
var option = $('option:selected', this).attr('mytag');