tmux, like other great software, is deceptive. On the one hand, it's fairly easy to get set up and start using right away. On the other hand, it's difficult to take advantage of tmux's adanced features without spending some quality alone time with the manual. But the problem with manuals is that they aren't geared toward beginners. They are geared toward helping seasoned developers and computer enthusiasts quickly obtain the
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Script to archive Slack messages from a channel list. | |
You have to create a Slack Bot and invite him to private channels. | |
View https://github.com/docmarionum1/slack-archive-bot for how to configure your account. | |
Then provide the bot token to this script with the list of channels. | |
''' | |
TOKEN='xoxb-xxxxx-xxxxxx-xxxxxxxxxxx' | |
channels = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source this file at the top of an R or Rmd file using rgrass7 together | |
# with GRASS installed via OSGeo4W (https://trac.osgeo.org/osgeo4w/) on a | |
# Windows machine. | |
# e.g. source(file.path(getwd(), 'rgrass7-setup-win-osgeo4w.R')) | |
# You can alternatively add the contents to a project-specific .Rprofile. | |
# Its better to set these variables in an R session rather than in System, | |
# especially if you have other GIS software like PostGIS installed, which has |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xarray as xr | |
import geopandas as gpd | |
import rasterio | |
# Open your shapefile and xarray object | |
ds = raster_mask | |
gdf = vector_mask | |
# Select shapefile feature you want to analyse | |
# and reproject to same CRS as xarray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start with all Lepidoptera museum records from | |
# Boyle, J., H. Dalgleish, and J. Puzey. 2019a. | |
# Data from: Monarch butterfly and milkweed declines substantially predate | |
# the use of genetically modified crops. Dryad Digital Repository. | |
# https://datadryad.org/resource/doi:10.5061/dryad.sk37gd2 | |
# these data were downloaded, cleaned, and saved with code provided in Dryad: | |
# PART 1.1 Filtering museum data.R | |
lep <- readRDS("lep_records.rds") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
import xarray | |
import matplotlib.pyplot as plt | |
import cartopy.crs as ccrs | |
import matplotlib.animation as anim | |
import cartopy | |
filenames = ['/g/data3/w97/dc8106/AMZ_def_EXPs/121GPsc_E0/AMZDEF.daily_tasmax.1978_2011_121GPsc_E0_SAmerica.nc'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(gganimate) | |
library(sf) | |
earth <- sf::st_as_sf(rnaturalearth::countries110) | |
views <- data.frame(rbind( | |
st_bbox(earth[earth$name == 'Denmark',]), | |
st_bbox(earth[earth$name == 'Australia',]) | |
)) | |
p <- ggplot() + | |
geom_sf(data = earth, fill = 'white') + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO (maybe) | |
# - Vectorize on URLs | |
# - Allow for downloading whole directory contents if path is a directory | |
# - Make a recursive = TRUE argument for this case | |
# - Error messages/input checking | |
#' Gets a file from a github repo, using the Data API blob endpoint | |
#' | |
#' This avoids the 1MB limit of the content API and uses [gh::gh] to deal with | |
#' authorization and such. See https://developer.github.com/v3/git/blobs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("sf") | |
require("dplyr") | |
require("hexbin") | |
# Linux libertine font "sf", converted to path with Inkscape, | |
# added points between existing points 2 times, then turned all segments into straight lines. | |
# Saved as SVG with absolute coordinates (Preferences > SVG Output > Path Data). | |
# Loaded coords from SVG source code, remove letters from start and end, and replace " " with "," | |
coords_f <- c(218.1169,163.46992,215.56952,177.96334,213.51976,189.84421,211.82546,200.33884,210.34442,210.67351,208.24728,226.35176,205.51032,243.54066,201.92029,259.27223,197.26391,270.57846,195.45112,272.90665,193.28288,274.70167,190.97247,275.85687,188.73314,276.26564,187.03291,276.03164,185.79476,275.38887,184.84097,274.42619,183.99382,273.23248,182.45947,271.13533,180.24976,269.10927,177.54243,267.58084,174.51519,266.97658,171.25987,267.58973,169.08867,269.18036,167.87718,271.37526,167.501,273.8012,168.44294,277.0032,171.48203,279.79643,176.93817,281.77214,185.13126,282.52154,191.01986,281.80176,196.83737,279.60686,202.29944, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: mkproj [projectname] | |
# projectname defaults to name of current directory | |
template="Version: 1.0 | |
RestoreWorkspace: No | |
SaveWorkspace: No | |
AlwaysSaveHistory: Yes |
NewerOlder