Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jmettes
jmettes / template.yml
Last active July 11, 2022 03:13
Basic usage of Argo WorkflowTemplates, with minimal duplication and boiler plate. The DAG is the only template, using inline sub-templates for tasks (instead of additional task templates), and a single global parameter passed by Workflow at top level (without having redefine the DAG structure to pass separate parameters)
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: workflow-template-submittable
spec:
entrypoint: dag
templates:
- name: dag
inputs:
parameters:
@jmettes
jmettes / template-min.xml
Created March 7, 2011 08:15
Minimal/bare-bones Blogger template; used as a starting point.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html>
<head>
<title>
<data:blog.pageTitle/>
</title>
<b:skin><![CDATA[]]></b:skin>
</head>
<body>
@jmettes
jmettes / build-closure.sh
Last active June 4, 2021 06:09
NixOS ISO
nix-build --attr system "./nixos.nix" -o result-closure
readlink -f result-closure > closure-nix-store-path.txt
rm -r system
mkdir system
nix copy ./result-closure --to file://./system
import cartopy.crs as ccrs
from mpl_toolkits.axes_grid1 import make_axes_locatable
proj = ccrs.PlateCarree()
fig, ax = plt.subplots(subplot_kw=dict(projection=proj), figsize=(10, 10))
s = ax.scatter(x['longitude'], x['latitude'], 10, x['iwv'])
gl = ax.gridlines(crs=proj, alpha=0.5, linestyle='--', draw_labels=True)
ax.coastlines(resolution='50m', color='black', linewidth=1)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jmettes
jmettes / install-nexus.sh
Last active January 10, 2019 10:58
Script for installing Nexus
# configure HTTP proxy
export http_proxy=http://rhe-proxy.prod.lan:8080
# persistent environment variable
echo "export http_proxy=http://rhe-proxy.prod.lan:8080" > /etc/profile.d/nexus.sh
# create nexus system account
/usr/sbin/adduser -r nexus
# install nexus as per http://books.sonatype.com/nexus-book/reference/install-sect-service.html
# http://cimss.ssec.wisc.edu/training_data/
# Record number:15,704
# Record length: 338
# Datatype: real*4
# RECORD FIELDS
# 1:101 temperature profile [K]
# 102:202 mixing ratio profile [kg/kg]
# 203:303 ozone profile [ppmv]
@jmettes
jmettes / maybe.hs
Last active June 26, 2017 14:27
Maybe types in haskell
-- example of a dumb function which adds one to its input, and throws exception if given 0
addOne :: Int -> Int
addOne n = case n of
0 -> error "dont add 0"
_ -> 1 + n
-- λ> 2 + (addOne 1)
-- 4