Skip to content

Instantly share code, notes, and snippets.

View dphans's full-sized avatar
🚀
Usually respond within a day

Bao Phan dphans

🚀
Usually respond within a day
View GitHub Profile
@erlingpaulsen
erlingpaulsen / coinbase_profit_loss.py
Created January 15, 2021 12:18
Python script for connecting to your Coinbase account through the API. Used to compute and plot the balance and cost per wallet and in total, in addition to calculate the total profit/loss. Will calculate to your native currency.
import json, hmac, hashlib, time, requests
import numpy as np
from requests.auth import AuthBase
import matplotlib.pyplot as plt
# Name of account holder (only for displaying)
USER = 'My name'
# API key and secret. Create these in your Coinbase account with all read permissions selected for all accounts
API_KEY = 'xxx'
@iamriajul
iamriajul / ConnectivityUtil.kt
Created April 26, 2021 05:19
Android Kotlin utility class for checking device's network connectivity and speed and internet availability. - You may use this with DI system easily.
package org.dailyislam.android.utilities
import android.content.Context
import android.net.ConnectivityManager
import android.net.NetworkInfo
import android.telephony.TelephonyManager
import java.net.InetAddress
class ConnectivityUtil(private val applicationContext: Context) {