Skip to content

Instantly share code, notes, and snippets.

View woodbri's full-sized avatar

Stephen Woodbridge woodbri

View GitHub Profile
@woodbri
woodbri / get-wind.py
Last active March 4, 2024 14:54
Python script to fetch GFS wind data and create a JSON file
#!/usr/bin/env python3
'''
get-winds.py
- get the latest data from nomads.ncep.noaa.gov unless we have it already
- generate file /maps/wms/data/windy.json
- generate windy.latest file with time stamp
'''
@woodbri
woodbri / parse-kml.php
Created November 1, 2017 21:23
Script to pasrse a kml file
<?php
$xml = simplexml_load_file('Peoples-Ranch-Map.kml-2.xml');
$folders = $xml->Document->Folder;
foreach ($folders as $folder) {
print "Name: " . $folder->name . "\n";
print "Description: " . $folder->description . "\n";
$children = $folder->children();
foreach ($children as $child) {
print ' Name: ' . $child->name . "\n";
@woodbri
woodbri / hycom-build-ubuntu-14_04.patch
Created June 8, 2016 21:41
Patches for HYCOM to build on Ubuntu 14.04
diff -aur hycom/ALL/archive/src/Make_all.src hycom-Ubuntu-10.04/ALL/archive/src/Make_all.src
--- hycom/ALL/archive/src/Make_all.src 2005-03-02 12:41:09.000000000 -0500
+++ hycom-Ubuntu-10.04/ALL/archive/src/Make_all.src 2016-06-07 14:42:48.778077614 -0400
@@ -15,4 +15,4 @@
#setenv ARCH t3e
#setenv ARCH x1
#
-setenv ARCH amd64
+setenv ARCH gfortran
diff -aur hycom/ALL/archive/src/Makefile hycom-Ubuntu-10.04/ALL/archive/src/Makefile
#!/usr/bin/env python
# Warning: This is not great code.
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@woodbri
woodbri / Makefile
Last active March 23, 2016 19:55 — forked from jl2/Makefile
A simple trie data structure in C++.
trie: main.cpp Makefile
clang++ -O3 -std=c++11 -stdlib=libc++ -Wall -o trie main.cpp -lboost_system
three way opt
* Local Search Heuristics
* b-------a b a
* . . => .\ /.
* . d...e . . e...d .
* ./ \. . .
* c f c-------f
@woodbri
woodbri / pgr_graphviz.sql
Last active July 25, 2016 17:44
Here is a stored procedure that can be user to create a GraphViz input file from a pgRouting edge table. It create a text output that can be copied to myfile.gv, then can be converted to an image using ``neato -Tpng -O myfile.gv`` and the image will be in ``myfile.gv.png``.
create or replace function pgr_graphviz(edge_table text,
eid text default 'id',
source text default 'source',
target text default 'target',
oneway text default '',
ft text[] default array['FT']::text[],
tf text[] default array['TF']::text[],
where_clause text default 'true',
nodepos bool default false)
returns text as
@woodbri
woodbri / doc_CMakeLists.txt
Created August 4, 2013 18:38
Here is my attempt to cleanup the Sphinx doc build stuff, but it does not work. It generates a ``make doc`` target, but it cannot find the sources files, so I have obviously messed up something.
#
# Find Sphinx
# Find Sphinx executable to build documentation
# Source: http://ericscottbarr.com/blog/2012/03/sphinx-and-cmake-beautiful-documentation-for-c-projects/
#
# Daniel Kastl 03/2013
#
set(SPHINX_THEME "haiku")
#set(SPHINX_THEME_DIR "_themes")