Skip to content

Instantly share code, notes, and snippets.

View karanatwal's full-sized avatar
😎
Working on something Big.

Karandeep Atwal karanatwal

😎
Working on something Big.
View GitHub Profile
@karanatwal
karanatwal / Terminal
Created February 2, 2019 05:09
FaceTime & iMessage Activation/Authentication Error Fix in Mac
sudo rm /Library/Preferences/com.apple.apsd.plist
//If you are getting Authentication or Error while activating your FaceTime & iMessage use above command in Terminal of your mac and enter password and restart mac. Then login again :)
@karanatwal
karanatwal / PhpFireBaseNotificationSample.php
Created July 17, 2018 16:10 — forked from MohammadaliMirhamed/PhpFireBaseNotificationSample.php
Simple PHP FireBase (FCM) script showing how to send an Android push notification. Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call http://sample.com/PhpFireBaseNotificationSample.php?id=THE_DEVICE_REGISTRATION_ID The main Code For GCM is https://gist.github.com/prime…
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',
@karanatwal
karanatwal / UriAwareEditText.java
Created March 5, 2018 19:04 — forked from oianmol/UriAwareEditText.java
This EditText will support GBOARD for gifs and other attachments like "image/png", "image/gif", "image/jpeg","image/webp"
package com.sports.spornado.util.view;
import android.content.Context;
import android.os.Bundle;
import android.support.v13.view.inputmethod.EditorInfoCompat;
import android.support.v13.view.inputmethod.InputConnectionCompat;
import android.support.v13.view.inputmethod.InputContentInfoCompat;
import android.support.v4.os.BuildCompat;
import android.util.AttributeSet;
import android.view.inputmethod.EditorInfo;
/**
* Workaround for this bug: https://code.google.com/p/android/issues/detail?id=222208
* In Android 7.0 Nougat, spinner mode for the DatePicker in DatePickerDialog is
* incorrectly displayed as calendar, even when the theme specifies otherwise.
*
* Modified slightly from the equivalent fix for TimePicker from @jeffdgr8:
* https://gist.github.com/jeffdgr8/6bc5f990bf0c13a7334ce385d482af9f
*/
private void fixSpinner(Context context, int year, int month, int dayOfMonth) {
// The spinner vs not distinction probably started in lollipop but applying this