Skip to content

Instantly share code, notes, and snippets.

View Plutor's full-sized avatar
🗯️

Logan Ingalls Plutor

🗯️
View GitHub Profile
@Plutor
Plutor / limitedminheap.php
Created December 16, 2011 18:37
A min-max heap and a limited-size min heap (in PHP)
<?php
include 'minmaxheap.php';
/* A min-heap that will restrict itself to a maximum of some number of values.
* Implemented internally as a min-max heap.
*
* Public API:
* - Contructor takes a number, used as the maximum number of values allowed on the heap
* - count() - returns the number of elements on the heap
@Plutor
Plutor / MLB-2012-schedule.csv
Created December 10, 2011 17:01
Shortest MLB roadtrip - depends on LimitedMinHeap from https://gist.github.com/1487321
DATE AWAY TEAM HOME TEAM STADIUM LAT LON
2012-03-28 Mariners Athletics Tokyo Dome 35.705658 139.751914
2012-03-29 Mariners Athletics Tokyo Dome 35.705658 139.751914
2012-04-04 Cardinals Marlins New Marlins Ballpark 25.778056 -80.219722
2012-04-05 Blue Jays Indians Progressive Field 41.49601 -81.68511
2012-04-05 Braves Mets Citi Field 40.756944 -73.845833
2012-04-05 Dodgers Padres PETCO Park 32.70724 -117.15708
2012-04-05 Marlins Reds Great American Ball Park 39.09714 -84.50707
2012-04-05 Nationals Cubs Wrigley Field 41.94822 -87.65536
2012-04-05 Phillies Pirates PNC Park 40.44684 -80.0056
@Plutor
Plutor / MLB-2011-schedule.csv
Created April 8, 2011 15:22
Full 2011 MLB schedule including lat/lon
DATE AWAY TEAM HOME TEAM LOCATION LATITUDE LONGITUDE
2011-03-31 Padres Cardinals Busch Stadium 38.62378 -90.19249
2011-03-31 Giants Dodgers Dodger Stadium 34.07388 -118.23996
2011-03-31 Braves Nationals Nationals Park 38.872778 -77.0075
2011-03-31 Brewers Reds Great American Ballpark 39.09714 -84.50707
2011-03-31 Angels Royals Kauffman Stadium 39.05158 -94.4801
2011-03-31 Tigers Yankees Yankee Stadium 40.829167 -73.926389
2011-04-01 Mariners Athletics Oakland Coliseum 37.75162 -122.20052
2011-04-01 Twins Blue Jays Rogers Centre 43.6414 -79.38917
2011-04-01 Pirates Cubs Wrigley Field 41.94822 -87.65536
@Plutor
Plutor / Random draft order
Created March 21, 2011 18:47
Script for establishing a random draft order for Fantasy Baseball 2011
#!/usr/bin/perl
@t=("D.J. Vajazzle",
"Tu Madre",
"Royal Rooters",
"The Darkhorse",
"The Mighty Hamsters",
"Amish Rake Fight",
"PhineusGageHeadaches",
"Misfit Chinese Food",
@Plutor
Plutor / A_star.html
Last active September 23, 2015 18:58
A little proof to myself that I understand A*.
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>A* demo</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<script type="text/javascript">
var size=81, fielddom, g, h;
var zeroes, walls, open, clos, camefrom, lastwalls, lastopen, lastclos;
var curx=Math.floor(size/2), cury=3;
var active = 1;