Skip to content

Instantly share code, notes, and snippets.

@kc9ryt
kc9ryt / MainActivity.java
Created August 13, 2020 01:02 — forked from Aeonitis/MainActivity.java
Android - Check Network State in your app, Notifying you when an app is online/offline
/**
* This would be the activity which registers the receiver class via it's interface
*/
public class MainActivity implements NetworkStateReceiver.NetworkStateReceiverListener {
private NetworkStateReceiver networkStateReceiver; // Receiver that detects network state changes
@Override
protected void onCreate(Bundle savedInstanceState) {
/***/
@kc9ryt
kc9ryt / feels_like.py
Created January 26, 2022 17:04 — forked from jfcarr/feels_like.py
"Feels Like" (temperature) Calculation in Python
# I use a Python script to pull current weather conditions from the NOAA web service API. The NOAA web
# service does not return a windchill value for all locations, but given temperature, relative humidity,
# and wind speed you can calculate a “feels like” temperature as follows.
# This code assumes units of Fahrenheit, MPH, and Relative Humidity by percentage. In this example, a
# temperature of 35F, wind speed of 10mph, and relative humidity of 72% yields a "feels like" value of 27.4F
import math
vTemperature = float(35)