Skip to content

Instantly share code, notes, and snippets.

View azubkokshe's full-sized avatar
💭
I may be slow to respond.

Alexandr Zub azubkokshe

💭
I may be slow to respond.
  • Kazdream Technologies
  • Kokshetau
View GitHub Profile
@ianturton
ianturton / CellTower.java
Last active October 27, 2021 11:23
GeoTools program to calculate a wedge shaped polygon 10 degrees wide given a lat,lon radius and azimuth.
package spike;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import org.geotools.referencing.GeodeticCalculator;
import org.geotools.referencing.crs.DefaultGeographicCRS;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.GeometryFactory;
@ngauthier
ngauthier / timeout_and_tick.go
Created February 10, 2015 18:14
Golang timeout and tick loop
// keepDoingSomething will keep trying to doSomething() until either
// we get a result from doSomething() or the timeout expires
func keepDoingSomething() (bool, error) {
timeout := time.After(5 * time.Second)
tick := time.Tick(500 * time.Millisecond)
// Keep trying until we're timed out or got a result or got an error
for {
select {
// Got a timeout! fail with a timeout error
case <-timeout: