Skip to content

Instantly share code, notes, and snippets.

import os
import datetime
import logging
import requests
import xarray as xr
logging.basicConfig(level=logging.DEBUG)
_variables = ['air', 'uwnd', 'vwnd', 'rhum']
@kclosu
kclosu / russia_300km_grid_bound.geojson
Created July 23, 2020 11:00
300km squared grid for Russia with 300km bound of coastline
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.
@kclosu
kclosu / gist:9c580f003656fdf69ea8a67129b9c10c
Created November 1, 2018 11:36
Add line to end of file with sudo on remote server via ssh
for server in "${servers[@]}"; do
sshpass -p "password" ssh -T username@${server} 'echo password | sudo echo "11.16.18.10 hostname.domain.org" | sudo tee /etc/hosts'
done
@kclosu
kclosu / ru-all-disputed.geo.json
Created March 29, 2018 17:04
Russian regions with administrative code
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kclosu
kclosu / gist:a9453ebf0dae3c6971ec307e0217d095
Created September 21, 2016 11:52
Have a string of XML and need an XML DOM
var dom = (new DOMParser()).parseFromString(xmlStr, 'text/xml');
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo by kclosu</title>
<script type='text/javascript' src='http://d3js.org/d3.v3.min.js'></script>
<html>
<meta charset="utf-8">
<head>
<style>
body { font: 10px sans-serif; }
p { font: 12px helvetica; }
.axis path, .axis line {
fill: none;
stroke: #000;