Skip to content

Instantly share code, notes, and snippets.


Jake Bathman jakebathman

View GitHub Profile
jakebathman / geoDistance.php
Last active Jul 15, 2020
Lat/Lon Distance Calculator
View geoDistance.php
* Calculate the distance between two points on a sphere
* Implements the Haversine formula:
* More advanced calculation (good for antipodal points) can be used by using
* FALSE for $boolUseHaversine. This will use another solution to the Great-circle
* ditance problem (, implementing
* the Vincenty formula (
jakebathman / botPost.php
Last active Jul 12, 2020
GroupMe bot post function including @mentions
View botPost.php
* Post a message from a bot to a group
* $groupId (string) GroupId of the group to post the message
* $strMessage (string) Text of the message to post (limit of 1000 characters)
* $strBotId (string) ID of the bot which will post the message
* $mentionUsers (array) [optional] array of userIds to mention (uses attachment)
* Example array of userIds:
jakebathman /
Created Mar 14, 2017
CentOS box initial setup script
# Base box setup steps
# Do the steps below as root user
sudo su
# The steps below are based on a clean install on
# CentOS 7 (build 1608)
jakebathman / StateBoundaries.sql
Last active Jun 10, 2020
The approximate max/min latitude and longitude for all states and major territories
View StateBoundaries.sql
-- Create the table
`State` varchar(10) DEFAULT NULL,
`Name` varchar(255) DEFAULT NULL,
`MinLat` varchar(50) DEFAULT NULL,
`MaxLat` varchar(50) DEFAULT NULL,
`MinLon` varchar(50) DEFAULT NULL,
`MaxLon` varchar(50) DEFAULT NULL
jakebathman / init.lua
Last active May 18, 2020
Hammerspoon config
View init.lua
-- Clear the console
-- Set the default grid
hs.grid.MARGINX = 0
hs.grid.MARGINY = 0
hs.grid.GRIDWIDTH = 20
hs.grid.GRIDHEIGHT = 100
-- Also can be set using hs.grid.setGrid'20x100'
jakebathman / jsonToCsv.php
Last active May 8, 2020 — forked from Kostanos/json-to-csv.php
A function to convert a JSON string (or a PHP array) to a CSV file or CSV string echoed to the browser
View jsonToCsv.php
* Based on (forked from) the work by
* This revision allows the PHP file to be included/required in another PHP file and called as a function, rather than focusing on command line usage.
* Convert JSON file to CSV and output it.
* JSON should be an array of objects, dictionaries with simple data structure
jakebathman / remove_laravel_comments.php
Last active Apr 29, 2020
Remove comments from fresh Laravel files
View remove_laravel_comments.php
| Remove Laravel Comments
| Just made a new Laravel project, but don't want all those big
| comment blocks? Put this in the root of your project and run
| "php remove_laravel_comments.php"
jakebathman /
Last active Jan 22, 2020
Laravel 5.8 deprecated helpers regex search
jakebathman / thats-no-moon.js
Created Jan 21, 2020
Get the current phase of the moon, and adjust a sprite for it
View thats-no-moon.js
const phases=[
{"sprite-x":123, "sprite-y":987, phase:"new"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-1"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-2"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-3"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-4"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-5"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-6"},
{"sprite-x":123, "sprite-y":987, phase:"quarter-1"},
{"sprite-x":123, "sprite-y":987, phase:"wax-gibbous-1"},

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vitae enim sollicitudin, placerat arcu vitae, tristique urna. Duis vitae commodo felis. Morbi tincidunt magna at turpis porttitor maximus.

Vivamus fermentum rutrum enim vitae ultrices. Pellentesque ac enim at sem aliquet convallis sit amet quis diam. Etiam sodales urna eget varius pretium. Vivamus id eros vehicula mauris auctor dictum sed rhoncus arcu. Pellentesque tincidunt magna lorem, et pretium mi rhoncus in. Mauris erat erat, elementum a congue ut, imperdiet quis turpis.

You can’t perform that action at this time.