Skip to content

Instantly share code, notes, and snippets.

View srstsavage's full-sized avatar

Shane St Savage srstsavage

View GitHub Profile
@srstsavage
srstsavage / nginx_google_analytics
Last active June 6, 2023 22:50
google analytics in nginx
# send logs for all traffic (including non-html) to google analytics
#
# in server block:
# set $google_analytics_id "UA-THECORRECT-ID";
# include /srv/nginx/google_analytics;
#
# in location blocks:
# post_action @ga;
#
# notes: post_action has been referred to by nginx devs as a "dirty hack" and this approach may stop working one day.
@srstsavage
srstsavage / affirmation
Created January 2, 2015 08:16
MuleSoft Contributor Agreement Acceptance by Shane StClair
I, Shane StClair, have read and do accept the MuleSoft Contributor Agreement
at http://www.mulesoft.org/legal/contributor-agreement.html
Accepted on Fri Jan 02 2015 00:16:18 GMT-0800 (PST)
@srstsavage
srstsavage / gist:11047907
Created April 18, 2014 14:48
swe:TimeInstantGrid
<swe:TimeInstantGrid>
<swe:extent>
<swe:TimeGridEnvelope>
<swe:low>3</swe:low>
<swe:high>102</swe:high>
</swe:TimeGridEnvelope>
</swe:extent>
<swe:originPos>2007-01-29T12:00:00.00+09:00</swe:originPos>
<swe:offsetDuration>PT12H</swe:offsetDuration>
<swe:duration>P50D</swe:duration>
@srstsavage
srstsavage / gist:11047567
Created April 18, 2014 14:39
min/max example from SensorML spec
<outputs>
<OutputList>
<output name="weatherMeasurements">
<swe:DataRecord gml:id="outputGroup">
<swe:field name="time">
<swe:Time definition="urn:ogc:def:property:OGC:observationTime">
<swe:uom xlink:href="urn:ogc:def:unit:ISO:8601"/>
</swe:Time>
</swe:field>
<swe:field name="temperature">
@srstsavage
srstsavage / gist:8608304
Created January 24, 2014 22:41
Hibernate hung process thread dump
Full thread dump OpenJDK 64-Bit Server VM (23.7-b01 mixed mode):
"Attach Listener" daemon prio=10 tid=0x00007f88d8001000 nid=0x1eea runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"DestroyJavaVM" prio=10 tid=0x00007f8938009000 nid=0x75eb waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"WeakCollectionCleaner" daemon prio=10 tid=0x00007f8938bfa800 nid=0x75fe in Object.wait() [0x00007f8918f0a000]
java.lang.Thread.State: WAITING (on object monitor)
@srstsavage
srstsavage / gist:8607219
Created January 24, 2014 21:43
HibernateUtil.closeSession
public static void closeSession() {
Session s = threadSession.get();
if( s != null && s.isOpen() && s.getTransaction() != null && s.getTransaction().isActive() ){
rollbackTransaction();
}
threadSession.set(null);
if (s != null ){
if( s.isOpen() ){
@srstsavage
srstsavage / gist:8586702
Created January 23, 2014 21:01
Generic IOOS CSV encoding
station_id,sensor_id,latitude (degree),longitude (degree),date_time,depth (m),observed_property,unit,value
urn:ioos:station:wmo:41012,urn:ioos:sensor:wmo:41012:watertemp1,30.04,-80.55,2008-08-01T00:50:00Z,0.60,http://mmisw.org/ont/cf/parameter/sea_water_temperature,degC,27.70
urn:ioos:station:wmo:41012,urn:ioos:sensor:wmo:41012:watertemp1,30.04,-80.55,2008-08-01T01:50:00Z,0.60,http://mmisw.org/ont/cf/parameter/sea_water_temperature,degC,27.70
urn:ioos:station:wmo:41012,urn:ioos:sensor:wmo:41012:watertemp1,30.04,-80.55,2008-08-01T02:50:00Z,0.60,http://mmisw.org/ont/cf/parameter/sea_water_temperature,degC,27.6
<sml:components>
<sml:ComponentList>
<sml:component name='wmo_41001'>
<sml:System>
<!-- ==================================================================== -->
<!-- PLATFORM IDENTIFIERS -->
<!-- Gives ability to platforms by name -->
<!-- ==================================================================== -->
<sml:identification>
<sml:IdentifierList>
@srstsavage
srstsavage / gist:5002835
Created February 21, 2013 07:01
Multistation, DataChoice for sensors
<om:result>
<swe2:DataStream>
<swe2:DataRecord>
<swe2:field name="stationID">
<swe2:Text definition="http://mmisw.org/ont/ioos/definition/stationID">
<swe2:value>urn:ioos:station:wmo:41001</swe2:value>
</swe2:Text>
</swe2:field>
<swe2:field name="location">
<swe2:Vector definition="http://www.opengis.net/def/property/OGC/0/PlatformLocation"