Skip to content

Instantly share code, notes, and snippets.

Avatar

Nat Taylor nattaylor

View GitHub Profile
@nattaylor
nattaylor / apache2ga.php
Created Nov 5, 2019
Server-side Google Analytics
View apache2ga.php
<?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
@nattaylor
nattaylor / out.php
Last active Jul 20, 2018
Zoning Board of Appeal Decisions - City of Boston
View out.php
<!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 {
@nattaylor
nattaylor / owa-notifications.user.js
Last active Jan 20, 2017
Outlook for Web Desktop Notifications Userscript
View owa-notifications.user.js
// ==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==
@nattaylor
nattaylor / afd.php
Last active Jan 15, 2016
Area Forecast Discussion parser
View afd.php
<?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 {
View gist:952d231ba879e08c4334
{
"491289025" : "ijinshan-kappmarket://",
"301521403" : "fb103361823069955://",
"492178411" : "ils492178411://",
"346142396" : "fb234434003713://",
"310633997" : "whatsapp://",
"370614765" : "com.condenet.newyorker://",
"325058491" : "rnmddisco://",
"382952264" : "epichttp://",
"477048487" : "predictwind://",
@nattaylor
nattaylor / quora.js
Created Aug 19, 2014
JavaScript snippets for parsing sites
View quora.js
//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);
You can’t perform that action at this time.