Skip to content

Instantly share code, notes, and snippets.

View karthiks's full-sized avatar
🎯
Focusing

Karthik Sirasanagandla karthiks

🎯
Focusing
View GitHub Profile
@karthiks
karthiks / enhanced-form.js
Last active April 2, 2018 10:48
Submit form at the click of an Enter/Return button
class EditTaskModal extends Component {
.
.
.
render() {
return (
<form onSubmit={(e)=>this.modifyTask(e)}>
<input className="ToDoInput" value={this.state.task} onChange={this.handleEditingTask} />
<button type="submit" className="ToDoSubmit"> Edit </button>
</form>
@karthiks
karthiks / simple-form.js
Last active April 2, 2018 10:36
Edit row item in a table at button click in a modal dialog using ReactJS
class EditModal extends Component {
.
.
.
render() {
return (
<input className="ToDoInput" value={this.state.task} onChange={this.handleEditingTask} />
<button onClick={(e)=>this.modifyTask(e)} className="ToDoSubmit"> Edit </button>
);
}
private NotificationUtils notificationUtils;
//..
public void someMethod() {
notificationUtils = new NotificationUtils(this);
notificationUtils.getNotificationManager().notify(random_id, getAndroidChannelNotification(title, body));
}
//..
@karthiks
karthiks / NotificationUtils.java
Created August 24, 2017 18:37
Create Notification object using Builder
public class NotificationUtils extends ContextWrapper {
public static final String ANDROID_CHANNEL_ID = "com.androidstuff.tutsplustalerts.ANDROID";
public static final String IOS_CHANNEL_ID = "com.androidstuff.tutsplustalerts.IOS";
public static final String ANDROID_CHANNEL_NAME = "ANDROID CHANNEL";
public static final String IOS_CHANNEL_NAME = "IOS CHANNEL";
private NotificationManager notificationManager;
public NotificationUtils(Context base) {
super(base);
@karthiks
karthiks / NotificationUtils.java
Last active August 22, 2018 13:15
Create NotificationChannel object per Channel, with the desired options
public class NotificationUtils extends ContextWrapper {
public static final String ANDROID_CHANNEL_ID = "com.androidstuff.tutsplustalerts.ANDROID";
public static final String IOS_CHANNEL_ID = "com.androidstuff.tutsplustalerts.IOS";
public static final String ANDROID_CHANNEL_NAME = "ANDROID CHANNEL";
public static final String IOS_CHANNEL_NAME = "IOS CHANNEL";
private NotificationManager notificationManager;
//..
public NotificationUtils(Context base) {
@karthiks
karthiks / NotificationUtil.java
Last active August 24, 2017 18:52
Create NotificationManager from SystemService
public class NotificationUtils extends ContextWrapper {
private NotificationManager notificationManager;
public NotificationManager getNotificationManager() {
if (notificationManager == null) {
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
}
return notificationManager;
}
}
@karthiks
karthiks / README.md
Created May 19, 2017 07:27 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@karthiks
karthiks / MyApp.java
Created January 17, 2017 11:17
CleverTap-Validator-Issue-1
public class MyApp extends Application {
@Override
public void onCreate() {
ActivityLifecycleCallback.register(this); //Must be called before super.onCreate()
super.onCreate();
if (BuildConfig.DEBUG) {
// During development, we set the SDK to debug mode,
// in order to log warnings or other important messages to Android logging system.
CleverTapAPI.setDebugLevel(1); // optional
}
@karthiks
karthiks / permissions.txt
Created January 8, 2017 18:32 — forked from Rainer-Lang/permissions.txt
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
@karthiks
karthiks / activity_android_ui_1.xml
Created April 17, 2016 08:03
Lesson Learnt playing with RelativeLayout in Android UI
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${relativePackage}.${activityClass}" >
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"