The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following 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
Library(dplyr) | |
# Which package to check | |
trias_namespace <- asNamespace("trias") | |
# Character vector of all functions and their arguments, print method of base ls with str() on every object | |
trias_fns_args <- capture.output(utils::lsf.str(trias_namespace)) | |
# Extract the functions |
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
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
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
## latest needed for recent bug fix in triangles | |
## remotes::install_github("hypertidy/quadmesh") | |
library(quadmesh) | |
r <- quadmesh::etopo | |
## volcano as a raster in 0:nr, 0:nc (just because it's small and familiar) | |
v <- raster::raster(volcano, xmn = 0, xmx = nrow(volcano), ymn = 0, ymx = ncol(volcano)) | |
v <- raster::aggregate(v, fact = 2) | |
## 2D plot in any projection |
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
# Add this to your .Rprofile | |
options( | |
error = quote(rlang::entrace()), | |
rlang__backtrace_on_error = "collapse" # or "branch" or "full" | |
) |
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(tidyverse) | |
library(igraph) | |
#### | |
# The pattern is to identify points to extend the structure of | |
# dyads and subsequent structures | |
# And make sure the extension isn't already part of the structure | |
#### |
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
#### | |
# Dependencies | |
#### | |
library(tidyverse) | |
library(igraph) | |
#### | |
# The pattern is to identify points to extend the structure of |
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
# plotting multiple progress bars on the same line, as a precursor to running | |
# the progress bars in parallel | |
library (progress) | |
library (future) | |
library (R6) | |
new_connection <- function () { | |
f <- tempfile() | |
file.create(f) |
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
# progress information in parallel processes (that use the same filesystem) | |
# the master function sets up a tempfile for each process, spawns processes, and | |
# passes the corresponding tempfile location to each; each process dumps | |
# progress information into its tempfile; the master function polls those files | |
# for the progress information and returns it to the screen; the previous line | |
# is overwritten, as for progress bars | |
library (future) | |
# an environment to stash file info in, to hack around scoping issues. A package |
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(silicate) | |
data("wrld_simpl", package = "maptools") | |
#edges are unique segments (undirected) | |
#segments are directed instances of edges, belonging to arcs/ways or feature boundaries | |
library(silicate) | |
library(sf) | |
x <- PATH(st_as_sf(wrld_simpl)) | |
#x <- PATH(minimal_mesh) |
NewerOlder