Skip to content

Instantly share code, notes, and snippets.

🇮🇳
Exploring ideas

Karthik Sirasanagandla karthiks

🇮🇳
Exploring ideas
Block or report user

Report or block karthiks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tmux-conf
# To enable mouse scroll in tmux pane
set -g mouse on
# Tmux to support colors
set -g default-terminal "screen-256color"
# Change the default prefix from C-b to C-z
set -g prefix C-z
unbind C-b
@karthiks
karthiks / install_minikube_ubuntu1810.sh
Last active Jan 28, 2019
Steps to install minikube on ubuntu 18.10
View install_minikube_ubuntu1810.sh
# Note of thanks: This code snippet is created using https://carbon.now.sh. Check it out!
# Update the system
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get upgrade
# Install KVM or VirtualBox or both
# I prefer KVM
# Installing virtualbox
@karthiks
karthiks / install_vbox60_ubuntu1810.sh
Created Jan 28, 2019
How to Install VirtualBox 6.0 on Ubuntu 18.10
View install_vbox60_ubuntu1810.sh
# Open the terminal and run the following commands:
# Add VirtualBox 6 repo keys
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
# Enable VirtualBox 6.0 repository
sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"
sudo apt-get update
@karthiks
karthiks / enhanced-form.js
Last active Apr 2, 2018
Submit form at the click of an Enter/Return button
View enhanced-form.js
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 Apr 2, 2018
Edit row item in a table at button click in a modal dialog using ReactJS
View simple-form.js
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>
);
}
View MainActivity.java
private NotificationUtils notificationUtils;
//..
public void someMethod() {
notificationUtils = new NotificationUtils(this);
notificationUtils.getNotificationManager().notify(random_id, getAndroidChannelNotification(title, body));
}
//..
@karthiks
karthiks / NotificationUtils.java
Created Aug 24, 2017
Create Notification object using Builder
View NotificationUtils.java
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 Aug 22, 2018
Create NotificationChannel object per Channel, with the desired options
View NotificationUtils.java
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 Aug 24, 2017
Create NotificationManager from SystemService
View NotificationUtil.java
public class NotificationUtils extends ContextWrapper {
private NotificationManager notificationManager;
public NotificationManager getNotificationManager() {
if (notificationManager == null) {
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
}
return notificationManager;
}
}
You can’t perform that action at this time.