- You can only count on yourself.
- Never reveal more than you have to.
- Execution is nine-tenths of the job.
- Give credit where credit is due.
- When all else fails, do it yourself.
- 90% of a project takes 90% of the time.
- The remaining 10% takes an additional 90% of the time.
- Never date a co-worker.
🤹♀️
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 | |
# AUTHOR: Bob Rudis <bob@rudis.net> (@hrbrmstr) | |
# LICENSE: MIT + file zLICENSE | |
TODAY=`date +%Y-%m-%d` | |
TODAY_MD=`date +%B\ %d,\ %Y` | |
YEAR=`date +%Y` | |
PACKAGENAME=$1 |
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) |
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
# 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
#### | |
# 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
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
# 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
## 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
// 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; // ¯\\_(ツ)_/¯ |
OlderNewer