Weekly Digest

My information highlights for the week:

CodeWhisperer on the Command Line

— CodeWhisperer is a general purpose code generator powered by Machine Learning. It provides real time code recommendations as you code. You’re most likely to have encountered it in an IDE like VS Code. CodeWhisperer now also works for a selection of 500+ CLI tools. When you type a command (like cd, git or aws) in your terminal, CodeWhisperer will display a list of sub-commands, options and arguments. It’s not going to replace man pages, but it will definitely increase your CLI productivity.

Jobs with Higher Income and Fewer Hours

— FlowingData published an article that looks at the relationship between income, education and hours worked. It identifies a selection of roles which pay well but demand less than 40 hours per week. Podiatry seems like a promising niche for slacking off with a high salary, but I don’t know… spending all day looking at feet?

httr2 v1.0.0

The R package {httr2} has hit a major version milestone featuring a stable user interface. If you work with HTTP requests in R and are currently using the {httr} package then you might want to take a look at {httr2}. The explicit request object in {httr2} means that it plays nicely with the pipe and integrates well into Tidyverse workflows. According to the {httr} Quickstart Guide the {httr2} package should now be used for new projects.

Making a simple query using {httr}, where everything is specified as arguments to the GET() function.

library(httr)

USER_AGENT = "Mozilla/5.0 (Ubuntu) Firefox/117.0"

response <- GET(
  "http://httpbin.org/get",
  add_headers("User-Agent" = USER_AGENT),
  query = list(key = "value")
)

The same query using {httr2}, where the request object is acted upon by subsequent methods in the pipeline.

library(httr2)

response <- request("http://httpbin.org/get") %>%
  req_user_agent(USER_AGENT) %>%
  req_url_query(key = "value") %>%
  req_perform()