You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.Rmd
+3-295Lines changed: 3 additions & 295 deletions
Original file line number
Diff line number
Diff line change
@@ -21,14 +21,11 @@ knitr::opts_chunk$set(
21
21
22
22
## See also:
23
23
24
-
*[rgithub](https://github.com/cscheid/rgithub) an R client for the Github API by Carlos Scheidegger
25
24
*[git2r](https://github.com/ropensci/git2r) an R client for the libgit2 C library by Stefan Widgren
26
25
*[gert](https://github.com/r-lib/gert) Simple git client for R by Jeroen Ooms
27
26
*[gistfo](https://github.com/MilesMcBain/gistfo) for turning your untitled RStudio tabs into gists!
28
27
29
-
## Quick start
30
-
31
-
### Install
28
+
## Install
32
29
33
30
Stable version from CRAN
34
31
@@ -39,307 +36,18 @@ install.packages("gistr")
39
36
Or dev version from GitHub.
40
37
41
38
```{r eval=FALSE}
42
-
devtools::install_github("ropensci/gistr")
39
+
remotes::install_github("ropensci/gistr")
43
40
```
44
41
45
42
```{r}
46
43
library("gistr")
47
44
```
48
45
49
-
### Authentication
50
-
51
-
There are two ways to authorise gistr to work with your GitHub account:
52
-
53
-
* Generate a personal access token (PAT) **with the gist scope selected** at [https://help.github.com/articles/creating-an-access-token-for-command-line-use](https://help.github.com/articles/creating-an-access-token-for-command-line-use) and record it in the `GITHUB_PAT` environment variable.
54
-
- To test out this approach, execute this in R: `Sys.setenv(GITHUB_PAT = "blahblahblah")`, where "blahblahblah" is the PAT you got from GitHub. Then take `gistr` out for a test drive.
55
-
- If that works, you will probably want to define the GITHUB_PAT environment variable in a file such as `~/.bash_profile` or `~/.Renviron`.
56
-
* Interactively login into your GitHub account and authorise with OAuth.
57
-
58
-
Using the PAT is recommended.
59
-
60
-
Using the `gist_auth()` function you can authenticate separately first, or if you're not authenticated, this function will run internally with each function call. If you have a PAT, that will be used, if not, OAuth will be used.
61
-
62
-
```{r eval=FALSE}
63
-
gist_auth()
64
-
```
65
-
66
-
### Workflow
67
-
68
-
In `gistr` you can use pipes, introduced perhaps first in R in the package `magrittr`, to pass outputs from one function to another. If you have used `dplyr` with pipes you can see the difference, and perhaps the utility, of this workflow over the traditional workflow in R. You can use a non-piping or a piping workflow with `gistr`. Examples below use a mix of both workflows. Here is an example of a piping workflow (with some explanation):
knit a code block (knitr code block notation missing, do add that in) (result not shown)
201
-
202
-
```{r eval=FALSE}
203
-
run({'
204
-
x <- letters
205
-
(numbers <- runif(8))
206
-
'}) %>% gist_create
207
-
```
208
-
209
-
knit a file from a gist, has to get file first (result not shown)
210
-
211
-
```{r eval=FALSE}
212
-
gists('minepublic')[[1]] %>% run() %>% update()
213
-
```
214
-
215
-
### working with images
216
-
217
-
The GitHub API doesn't let you upload binary files (e.g., images) via their HTTP API, which we use in `gistr`. There is a workaround.
218
-
219
-
If you are using `.Rmd` or `.Rnw` files, you can set `imgur_inject = TRUE` in `gistr_create()` so that imgur knit options are injected at the top of your file so that images will be uploaded to imgur. Alternatively, you can do this yourself, setting knit options to use imgur.
#> Description: This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
#> Description: This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
* Please [report any issues or bugs](https://github.com/ropensci/gistr/issues).
339
49
* License: MIT
340
50
* Get citation information for `gistr` in R doing `citation(package = 'gistr')`
341
-
* Please note that this project is released with a [Contributor Code of Conduct][coc]. By participating in this project you agree to abide by its terms.
51
+
* Please note that this package is released with a [Contributor Code of Conduct](https://ropensci.org/code-of-conduct/). By contributing to this project, you agree to abide by its terms.
0 commit comments