Skip to content

Instantly share code, notes, and snippets.

View lukecampbell's full-sized avatar

Luke Campbell lukecampbell

View GitHub Profile
{
"ssh": {
"standard_name": "sea_surface_height$|sea_surface_elevation|sea_surface_height_above_sea_level$",
"name": "(?i)sea_surface_elevation(?!.*?_qc)|(?i)sea_surface_height_above_sea_level_geoid_mllw$|(?i)zeta$|(?i)Sea Surface Height(?!.*?_qc)|(?i)Water Surface above Datum(?!.*?_qc)"
},
"temp": {
"name": "(?i)temp$|(?i)temperature$|(?i)tem$|(?i)s.sea_water_temperature$|(?i)temperature(?!.*(skin|ground|air|_qc))"
},
"salt": {
"standard_name": "sea_water_salinity$|sea_water_practical_salinity$",
@lukecampbell
lukecampbell / example.geojson
Created June 24, 2022 17:22
An example of how it might look to plot
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lukecampbell
lukecampbell / genpass.py
Created November 9, 2021 23:15
genpass.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
'''
from __future__ import print_function
from argparse import ArgumentParser
import sys
import random
#!/usr/bin/env python
'''
split-certs.py
Splits certificates
'''
from __future__ import print_function
from argparse import ArgumentParser
import os
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
public class Hexdump {
public static void main(String[] args) {
System.out.println("Hello");
System.out.println(hexdump("Hello helo hell"));
}
public static String hexdump(String str) {
char[] chars = str.toCharArray();
StringBuilder sb = new StringBuilder();
#!/usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
import sys
import os
import csv
source_file_suffixes = [
'.java',
'.js',
@lukecampbell
lukecampbell / momentEquality.js
Last active January 17, 2018 16:44
Equality Properties of moment
const moment = require('moment');
let a = moment.utc('2018-01-16T13:00:00Z');
let b = moment('2018-01-16T13:00:00Z');
let c = moment.utc('2018-01-16T13:00:00Z');
// Reflexive
console.log('reflexive');
console.log('a == a', a.isSame(a));
@lukecampbell
lukecampbell / conversions.py
Created August 9, 2017 20:12
Converting web mercator projections
scale_factor = np.pi/128.
inverse_scale_factor = 1/scale_factor
def lam(x, z):
return np.rad2deg(x / np.power(2, zoom) * scale_factor - np.pi)
def phi(y, z):
angle = np.pi - scale_factor * y/(np.power(2, z))
@lukecampbell
lukecampbell / CSW-discovery.xsd
Created April 24, 2017 19:11
Troubleshooting lxml
<?xml version="1.0"?>
<xsd:schema
id="csw-discovery"
targetNamespace="http://www.opengis.net/cat/csw/2.0.2"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:ows="http://www.opengis.net/ows"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
version="2.0.2 2010-01-22">