Skip to content

Instantly share code, notes, and snippets.

View adib2149's full-sized avatar
👨‍⚕️
Open to work in Industry research roles [Causal Inference / Data Science]

Riddhiman Adib adib2149

👨‍⚕️
Open to work in Industry research roles [Causal Inference / Data Science]
View GitHub Profile
@adib2149
adib2149 / grouped_stacked_bar_plot.ipynb
Created September 22, 2022 03:23
A Grouped Stacked Bar Plot Implementation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adib2149
adib2149 / Python3 Virtualenv Setup.md
Created July 24, 2018 01:57 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@adib2149
adib2149 / CommonExtensions.kt
Created June 8, 2017 13:09 — forked from adavis/CommonExtensions.kt
Common Android Extensions in Kotlin
fun View.visible() {
visibility = View.VISIBLE
}
fun View.invisible() {
visibility = View.INVISIBLE
}
fun View.gone() {
visibility = View.GONE
@adib2149
adib2149 / Human Time Difference in Android
Created December 5, 2016 06:32
The function gives time difference between local time and time sent from server in the format that is readable to human, i.e, "3 hours ago", "1 day ago" etc.
public String processTime(String s) {
// parse server time
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss");
Date reviewDate = null;
try {
reviewDate = sdf.parse(s);
}catch(Exception ex){
ex.printStackTrace();
}
package nav.bottom;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@adib2149
adib2149 / BottomNavViewListener
Created October 25, 2016 10:16
This creates a listener to change the view (fragments) based on click
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.frameLayout, FirstFragment.newInstance());
fragmentTransaction.commit();
bottomNavigationView = (BottomNavigationView) findViewById(R.id.navigation);
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
Fragment fragment = null;
switch (item.getItemId()) {
@adib2149
adib2149 / AndroidManifest.xml
Created August 9, 2016 07:32 — forked from BrandonSmith/AndroidManifest.xml
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
@adib2149
adib2149 / facebook check-in details
Last active August 8, 2016 09:47
just a basic workflow on how to post on Facebook
/**
* needs permission: user_photos, publish_actions
*
* PSEUDOCODE:
* if (hasPhoto) {
* albumId = getAlbumId();
* if (albumId == null) {
* albumId = createAndGetAlbumId();
* }
* photoId(s) = addPhotoToAlbumAndGetId(albumId);
#!/bin/bash
# Get the IP of the connected android device
IP=`adb shell netcfg | grep wlan0 | awk '{ print $3 }' | awk -F'/' '{ print $1 }'`
# Port used for connecting, on device. Change as required
DEBUG_PORT='5555'
# Start the adb as tcpip deamon
adb tcpip $DEBUG_PORT