Skip to content

Instantly share code, notes, and snippets.

View gegen07's full-sized avatar

Germano Barcelos gegen07

View GitHub Profile
@jaradc
jaradc / entropy_calculation_in_python.py
Last active April 3, 2024 18:16
Four different ways to calculate entropy in Python
import numpy as np
from scipy.stats import entropy
from math import log, e
import pandas as pd
import timeit
def entropy1(labels, base=None):
value,counts = np.unique(labels, return_counts=True)
return entropy(counts, base=base)
@Gnzlt
Gnzlt / RestClient.java
Created December 5, 2016 11:20
Basic Retrofit RestClient for offline cache using interceptors
public class RestClient {
private static MyEndpoints sMyEndpoints;
public static void init(Context context) {
sMyEndpoints = getRetrofit(context).create(MyEndpoints.class);
}
private static Retrofit getRetrofit(Context context) {
return new Retrofit.Builder()
@wh1tney
wh1tney / deploy-static-site-heroku.md
Last active July 27, 2024 16:54
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions