Skip to content

Instantly share code, notes, and snippets.

@stucka
stucka / gist:42396118a76ea35484c61b3795c87717
Created September 7, 2017 14:26
Palm Beach County shelter list
The list of shelters opening in Palm Beach County at 10 a.m. Friday:
<ul>
<li><a href="https://www.google.com/maps/dir//Forest+Hill+Community+High+School,+6901+Parker+Ave,+West+Palm+Beach,+FL+33405/@26.6545343,-80.0995429,13z/data=!3m1!4b1!4m8!4m7!1m0!1m5!1m1!1s0x88d8d799fe898e2d:0x7c743bbe648b8301!2m2!1d-80.0645235!2d26.6545386" target="_blank">Forest Hill High School, 6901 Parker Ave, West Palm Beach</a>
<li><a href="https://www.google.com/maps/dir//West+Gate+Elementary,+1545+Loxahatchee+Dr,+West+Palm+Beach,+FL+33409/@26.7003797,-80.1264927,13z/data=!3m1!4b1!4m8!4m7!1m0!1m5!1m1!1s0x88d8d625c659b209:0x18987b6a2a8cce5f!2m2!1d-80.0914733!2d26.700384" target="_blank">West Gate Elementary School, 1545 Loxahatchee Dr, West Palm Beach</a>
<li><a href="https://www.google.com/maps/dir//Independence+Middle+School,+4001+Greenway+Dr,+Jupiter,+FL+33458/@26.8978961,-80.1571386,13z/data=!3m1!4b1!4m8!4m7!1m0!1m5!1m1!1s0x88ded5c0138830b1:0x459715637fa295c2!2m2!1d-80.1221192!2d26.8979004" target="_blank">Independence Middle
@stucka
stucka / gist:2bc0fe8ba3c568b181470cd4ae2dae32
Last active September 9, 2017 04:15
Palm Beach County hurricane shelter MAP
<div style="width:90%;">
Palm Beach County's general population emergency shelters for Hurricane Irma:<br>
<iframe width="100%" height="500" scrolling="no" frameborder="no" src="https://fusiontables.google.com/embedviz?q=select+col1+from+17jS9aQ3X_3MRWK8hZzP9EiAAEQP9uQzVf8lSNYNb&amp;viz=MAP&amp;h=false&amp;lat=26.68320244936722&amp;lng=-80.41011398754882&amp;t=1&amp;z=9&amp;l=col1&amp;y=2&amp;tmplt=2&amp;hml=GEOCODABLE"></iframe>
</div>
@stucka
stucka / gist:0d8eecb06767dcee7303badd1335a43c
Created September 7, 2017 14:33
Palm Beach County evacuation zone map with key
<div style="width:90%;">
<p>Palm Beach County evacuation zones are determined by the threat of storm surge, not the wind "Category" of a hurricane. Zones are on the Atlantic coast as well as near Pahokee, Belle Glade and Lake Okeechobee.</p>
<p>Palm Beach County has <A HREF="http://www.pbcgov.com/knowurzone/" target="_blank">a map searchable by address.</A></p>
<p>Evacuation <font color="#FF0000">&#x25ae;</font>&nbsp;Zone&nbsp;A: Evacuate if you live in a manufactured/mobile home, have substandard construction; or live in a flood-prone area.
<p>Evacuation Zones <font color="#FF8000">&#x25ae;</font>&nbsp;B,
<font color="#fff000">&#x25ae;</font>&nbsp;C,
<font color="#38d800">&#x25ae;</font>&nbsp;D,
@stucka
stucka / gist:d3fd957c14dfca825fc30581e49e305f
Created September 7, 2017 14:33
Palm Beach County evacuation zone map with key
<div style="width:90%;">
<p>Palm Beach County evacuation zones are determined by the threat of storm surge, not the wind "Category" of a hurricane. Zones are on the Atlantic coast as well as near Pahokee, Belle Glade and Lake Okeechobee.</p>
<p>Palm Beach County has <A HREF="http://www.pbcgov.com/knowurzone/" target="_blank">a map searchable by address.</A></p>
<p>Evacuation <font color="#FF0000">&#x25ae;</font>&nbsp;Zone&nbsp;A: Evacuate if you live in a manufactured/mobile home, have substandard construction; or live in a flood-prone area.
<p>Evacuation Zones <font color="#FF8000">&#x25ae;</font>&nbsp;B,
<font color="#fff000">&#x25ae;</font>&nbsp;C,
<font color="#38d800">&#x25ae;</font>&nbsp;D,
@stucka
stucka / mysqlbackup.bat
Last active December 29, 2017 21:29
MySQL backup script with file naming
set datestr=%date:~10,4%-%date:~4,2%-%date:~7,2%
"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqldump" --add-drop-database --all-databases --user=root -p >d:\mysqldump-stucka%datestr%.sql
@stucka
stucka / yearcalculate.py
Created February 13, 2018 18:11
Given Google Sheet date serial and a target date (election?) calculate difference in years
def calculate_age(dobstring, targetdate):
import datetime
# Takes Google Sheets (Excel)-formatted date value, and YYYY-MM-DD formatted date.
dobobject = datetime.datetime(1899, 12, 30) + datetime.timedelta(days=dobstring)
# print(dobobject)
targetobject = datetime.datetime.strptime(targetdate, "%Y-%m-%d")
years = targetobject.year - dobobject.year
if targetobject.month < dobobject.month or (targetobject.month == dobobject.month and targetobject.day < dobobject.day):
years -= 1
return(years)
@stucka
stucka / uwsp.ipynb
Created April 19, 2018 19:04
UWSP agenda scraper
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stucka
stucka / getsunrise.py
Created May 25, 2018 19:09
Find sunrise, sunset and duration of sunlight at a given point. Haven't verified this works.
import ephem
import datetime
basedate = datetime.datetime.strptime("2018-01-01", "%Y-%m-%d")
target = ephem.Observer()
target.lat = "38.6247"
target.long = "-90.185"
target.elevation = 142 #meters
sun = ephem.Sun()
print("date\trise\tset\tseconds")
for deltadays in range (0, 800):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stucka
stucka / timestamp.py
Created November 28, 2018 20:12
Easy timestamp in Python
def timestamp():
import datetime
return(datetime.datetime.strftime(datetime.datetime.now(), "%Y-%m-%dT%H:%M:%S"))