Skip to content

Instantly share code, notes, and snippets.

@Birdasaur
Birdasaur / mexico-airports.csv
Created April 17, 2023 21:44
mexico-airports.csv
id ident name latitude_deg longitude_deg elevation_ft
4688 MMAA Aeropuerto Internacional Juan N. Álvarez 16.762118 -99.755473 16
4706 MMCZ Aeropuerto Internacional de Cozumel 20.511425 -86.930287 15
4707 MMDO Aeropuerto Internacional Gral, Guadalupe Victoria 24.125908 -104.533904 6104
4710 MMGL Aeropuerto Internacional Miguel Hidalgo 20.52504 -103.301557 5016
4713 MMHO General Ignacio P. Garcia International Airport 29.09589958 -111.0479965 627
4722 MMLO Aeropuerto Internacional Del Bajío 20.985813 -101.478825 5956
4726 MMMD Aeropuerto Internacional Manuel Crescencio Rejón 20.933384 -89.662621 38
4731 MMMX Aeropuerto Internacional Lic. Benito Juárez 19.435433 -99.082432 7316
4732 MMMY Aeropuerto Internacional Gral. Mariano Escobedo 25.778561 -100.113602 1278
@Birdasaur
Birdasaur / mexico-capitols.csv
Created April 17, 2023 21:53
mexico-capitols.csv
city lat lng population
Mexico City 19.4333 -99.1333 21505000
Guadalajara 20.6767 -103.3475 5437000
Puebla 19.0333 -98.1833 1576259
Monterrey 25.6667 -100.3 1135512
Mexicali 32.6633 -115.4678 1049792
Villahermosa 17.9892 -92.9281 1013484
Aguascalientes 21.876 -102.296 934424
Mérida 20.97 -89.62 892363
Chihuahua 28.6353 -106.0889 878062
@Birdasaur
Birdasaur / world-110m.json
Created April 21, 2023 12:32
world-110m.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Birdasaur
Birdasaur / geoBoundaries-MEX-ADM1.topojson
Created April 24, 2023 11:30
geoBoundaries-MEX-ADM1.topojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Birdasaur
Birdasaur / countries-110m.json
Created April 24, 2023 11:40
countries-110m.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Birdasaur
Birdasaur / gist:a14c498a4f791e0053610e58aa1564b7
Last active February 10, 2024 16:33
JavaFX 3D example on how to arbitrarily rotate one 3D Node to "look at" another.
public static Affine lookAt(Node node, Point3D from, Point3D to, boolean applyTranslate) {
//zVec is "forward"
Point3D zVec = to.subtract(from).normalize();
//ydir is "up"
Point3D ydir = Rotate.Y_AXIS;
Point3D tangent0 = zVec.crossProduct(ydir);
//handle edge case where to location is precisely the "up" direction
if(tangent0.magnitude() < 0.001){
//pick a different axis to use
ydir = Rotate.X_AXIS;
@Birdasaur
Birdasaur / gist:23e8bed1965e517ea558e8cbf5a0b158
Created April 15, 2025 17:26
Python script to inject data and command Trinity over the wire using JSON
import json
import httpx
trinityURL = "http://localhost:8080";
print("switching to Hyperspace View...");
cmdJson = {
'messageType': 'command_request',
'request': 'VIEW_HYPERSPACE',
}
@Birdasaur
Birdasaur / RadialGrid.java
Created June 18, 2025 00:36
Animated 3D Radial Grid using JavaFX 3D
package edu.jhuapl.trinity.javafx.javafx3d.animated;
import javafx.animation.AnimationTimer;
import javafx.geometry.Point3D;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.paint.PhongMaterial;
import javafx.scene.shape.Cylinder;
import javafx.scene.transform.Rotate;