This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Work with NDBC historical data""" | |
import io | |
import csv | |
import datetime | |
import gzip | |
import requests | |
import re | |
from typing import Iterable, Optional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Parse AFD and output formatted HTML | |
Design: | |
1. Retrieve AFD | |
2. Parse topics via regex | |
3. Light post-processing | |
4. Format HTML template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Send Apache Logs to Google Analytics | |
*/ | |
// URL to send logs to | |
const GA = 'https://www.google-analytics.com/batch'; | |
// Path to log to process | |
const LOG = '/var/log/httpd/access_log'; | |
// Path to file storing byte offset of already processed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Zoning Board of Appeal Decisions - City of Boston</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body { | |
font-family: sans-serif; | |
} | |
table { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Outlook Web App Notifications | |
// @author nattaylor@gmail.com | |
// @namespace Notifications | |
// @include https://*/owa/* | |
// @exclude https://*/manifests/appCacheManifestHandler.ashx* | |
// @version 1 | |
// @grant none | |
// @description Display WebAPI Desktop notifications for new messages | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Parse the NWS Area Forecast Discussion (AFD) | |
* | |
* Adds casing and formating to the AFD, which is published as an | |
* all uppercase `<pre>` block with hard line breaks and no formatting. | |
* | |
* Usage: <?php $afd = new AreaForecastDiscussion("BOX"); echo $afd->generateHTML(); ?> | |
*/ | |
class AreaForecastDiscussion { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"491289025" : "ijinshan-kappmarket://", | |
"301521403" : "fb103361823069955://", | |
"492178411" : "ils492178411://", | |
"346142396" : "fb234434003713://", | |
"310633997" : "whatsapp://", | |
"370614765" : "com.condenet.newyorker://", | |
"325058491" : "rnmddisco://", | |
"382952264" : "epichttp://", | |
"477048487" : "predictwind://", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Sort open Quora questions by most recent | |
//Go through each item and give it a timestamp | |
jQuery(".pagedlist_item").each(function(i,e){ | |
//Find the timestamp for each item | |
var ts = jQuery(e).find(".timestamp").text(); | |
//Timestamps from the current year don't have a year | |
if (ts.indexOf(",")<0) { | |
ts += ", 2014"; | |
ts = Date.parse(ts); |