This file contains hidden or 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(sf) | |
library(mapview) | |
library(furrr) | |
library(raster) | |
plan(multiprocess) | |
ex = extent(c(xmin=-112,xmax=155,ymin=-44,ymax=-10)) |
This file contains hidden or 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
/// An extension to provide conversion to and from Y′UV colors. | |
extension UIColor { | |
/// The Y′UV components of a color - luma (Y′) and chroma (U,V). | |
struct YUV: Hashable { | |
/// The luma component of the color, in the range [0, 1] (black to white). | |
var Y: CGFloat | |
/// The blue-difference chroma component of the color, in the range [-0.436, 0.436]. | |
var U: CGFloat |
This file contains hidden or 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
var str = "2018/12/06 12:28 \\ - Ourdoor Run: Making a habbit.fgworkout" | |
extension String { | |
func sanitized() -> String { | |
// see for ressoning on charachrer sets https://superuser.com/a/358861 | |
let invalidCharacters = CharacterSet(charactersIn: "\\/:*?\"<>|") | |
.union(.newlines) | |
.union(.illegalCharacters) | |
.union(.controlCharacters) | |
This file contains hidden or 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
func printDate(string: String) { | |
let date = Date() | |
let formatter = DateFormatter() | |
formatter.dateFormat = "HH:mm:ss.SSSS" | |
print(string + formatter.string(from: date)) | |
} |
This file contains hidden or 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
# An example based on http://shiny.rstudio.com/articles/dynamic-ui.html | |
library(shiny) | |
ui = basicPage( | |
fluidRow( | |
actionButton(inputId = "add_buttons", label = "Add 5 Buttons") | |
), | |
uiOutput("more_buttons") # this is where the dynamically added buttons will go. | |
) |