Skip to content

Instantly share code, notes, and snippets.

View jrastaban's full-sized avatar
✈️
Building the future of travel

John Richards II jrastaban

✈️
Building the future of travel
View GitHub Profile
function haversineDistance(lat1, lon1, lat2, lon2) {
const toRad = (x) => (x * Math.PI) / 180;
const R = 6371; // Radius of Earth in km
const dLat = toRad(lat2 - lat1);
const dLon = toRad(lon2 - lon1);
const a =
Math.sin(dLat / 2) ** 2 +
Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *
<?php
//start wordpress
$today = getdate();
$the_query = new WP_Query(array(
'post_status' => 'future',
'orderby' => 'date',
'order' => 'ASC'