Skip to content

Instantly share code, notes, and snippets.

library(tidyverse, warn.conflicts = FALSE)
# data frame
mtcars
# as tibble
as.tibble(mtcars)
# rownames_to_column()
rownames_to_column(mtcars)
=== npm audit security report ===
# Run npm install --save-dev [email protected] to resolve 64 vulnerabilities
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Regular Expression Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ minimatch │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ zuul [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
library(dplyr)
ruler <- function(width = getOption("width")) {
x <- seq_len(width)
y <- case_when(
x %% 10 == 0 ~ as.character((x %/% 10) %% 10),
x %% 5 == 0 ~ "+",
TRUE ~ "-"
)
cat(y, "\n", sep = "")
cat(x %% 10, "\n", sep = "")
import CustomBounce from './src/CustomBounce'
import CustomEase from './src/CustomEase'
import CustomWiggle from './src/CustomWiggle'
import DrawSVGPlugin from './src/DrawSVGPlugin'
import GSDevTools from './src/GSDevTools'
import MorphSVGPlugin from './src/MorphSVGPlugin'
import Physics2DPlugin from './src/Physics2DPlugin'
import PhysicsPropsPlugin from './src/PhysicsPropsPlugin'
import ScrambleTextPlugin from './src/ScrambleTextPlugin'
# https://developer.github.com/v3/issues/#create-an-issue
# POST /repos/:owner/:repo/issues
library(gh)
# gh("POST /repos/:owner/:repo/issues", owner = "batpigandme", repo = "palaver", title = "Testing issue", body = "This is a test")
gh::gh("POST /repos/:owner/:repo/issues", owner = "REPO OWNER HERE", repo = "REPO NAME HERE", title = "Prepare for release",
body = "Prepare for release:
library(dplyr, warn.conflicts = FALSE)
library(rlang, warn.conflicts = FALSE)
punks_feelings <- tibble(
lucky = FALSE,
hungry = TRUE,
antsy = TRUE,
happy = FALSE,
sad = TRUE
)
@batpigandme
batpigandme / tidyr_crossing_2003_draft.R
Created August 17, 2018 14:46
TIL about tidyr::crossing() — who knew? Probably, like, a lot of people… Also, how awesome is glue?
suppressPackageStartupMessages(library(tidyverse))
player <- c("LeBron James", "Carmelo Anthony", "Dwyane Wade")
season_end_year <- c(2004:2018)
player_data <- tidyr::crossing(player, season_end_year)
player_data %>%
mutate(season = str_glue("{season_end_year - 1}-{season_end_year}")) %>%
select(-season_end_year)
@batpigandme
batpigandme / homebrew_bork.txt
Created August 9, 2018 14:33
I don't even know how I did this…
=======
^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ffmpeg.rb:101: syntax error, unexpected >>, expecting keyword_end
>>>>>>> Stashed changes
^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ffmpeg.rb:102: syntax error, unexpected >>, expecting keyword_end
>>>>>>> Stashed changes
^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ffmpeg.rb:103: syntax error, unexpected >>, expecting keyword_end
>>>>>>> Stashed changes
Rendering content/articles/2018-05-ggplot2-3-0-0-upcoming-release.Rmarkdown
*** caught illegal operation ***
address 0x7fffc6796e97, cause 'illegal opcode'
Traceback:
1: dyn.load(file, DLLpath = DLLpath, ...)
2: library.dynam(lib, package, package.lib)
3: loadNamespace(name)
4: doTryCatch(return(expr), name, parentenv, handler)
usethis::use_tidy_thanks("tidyverse/haven", from = "2018-01-18")
#> ● 173 contributors identified
#>   [\@adeldaoud](https://github.com/adeldaoud), [\@afleishman](https://github.com/afleishman), [\@aftollefsen](https://github.com/aftollefsen), [\@aghaynes](https://github.com/aghaynes), [\@AHoerner](https://github.com/AHoerner), [\@ajdamico](https://github.com/ajdamico), [\@ajmazurie](https://github.com/ajmazurie), [\@akitepowell](https://github.com/akitepowell), [\@alawami](https://github.com/alawami), [\@alimanager](https://github.com/alimanager), [\@allitnils](https://github.com/allitnils), [\@AmyMikhail](https://github.com/AmyMikhail), [\@andrewheiss](https://github.com/andrewheiss), [\@anhqle](https://github.com/anhqle), [\@annennenne](https://github.com/annennenne), [\@anoopxaviour](https://github.com/anoopxaviour), [\@aszalucha](https://github.com/aszalucha), [\@austensen](https://github.com/austensen), [\@avallecam](https://github.com/avallecam), [\@awmercer](https://github.com/awmercer), [\@bamo