Skip to content

Instantly share code, notes, and snippets.

View Zaherkorechi's full-sized avatar

Zaher Abd Ulmoula Zaherkorechi

View GitHub Profile
@Zaherkorechi
Zaherkorechi / IPAddressText.java
Created March 4, 2022 21:11 — forked from fingerboxes/IPAddressText.java
Android widget for inputting numeric IP addresses
/**
* EditText that only allows input of IP Addresses, using the Phone
* input type, and automatically inserts periods at the earliest appropriate
* interval.
*/
// Note; this probably isn't the best pattern for this - a Factory of Decorator
// pattern would have made more sense, rather than inheritance. However, this
// pattern is consistent with how other android Widgets are invoked, so I went
// with this to prevent confusion
@Zaherkorechi
Zaherkorechi / geo.kt
Created April 12, 2022 12:11 — forked from vs-krasnov/geo.kt
Simple function to calculate a new point's latitude and longitude based on provided start point, bearing and distance.
fun getPointByDistanceAndBearing(lat: Double, lon: Double, bearing: Double, distanceKm: Double): Pair<Double, Double> {
val earthRadius = 6378.1
val bearingR = Math.toRadians(bearing)
val latR = Math.toRadians(lat)
val lonR = Math.toRadians(lon)
val distanceToRadius = distanceKm / earthRadius
@Zaherkorechi
Zaherkorechi / get-ntrip-source-table.py
Created June 29, 2023 20:19 — forked from esutton/get-ntrip-source-table.py
HTPP Get NTRIP Server SOURCETABLE
#!/usr/bin/env python
#################################
# Get SOURCETABLE from an NTRIP server to discover mount points.
#
# Example:
#
# GET / HTTP/1.0
# Host: ok.smartnetna.com:10000
# User-Agent: MyAppName