Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit fb25a96

Browse files
committed
rename vignette so it shows up in docs as get started
1 parent 34edb30 commit fb25a96

File tree

4 files changed

+113
-78
lines changed

4 files changed

+113
-78
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
all: move rmd2md
22

33
move:
4-
cp inst/vign/gistr_vignette.md vignettes/
4+
cp inst/vign/gistr.md vignettes/
55
cp -rf inst/vign/img/* vignettes/img/
66

77
rmd2md:
88
cd vignettes;\
9-
mv gistr_vignette.md gistr_vignette.Rmd
9+
mv gistr.md gistr.Rmd
File renamed without changes.
File renamed without changes.

vignettes/gistr_vignette.Rmd renamed to vignettes/gistr.Rmd

Lines changed: 111 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ rate_limit()
8484

8585
```
8686
#> Rate limit: 5000
87-
#> Remaining: 4908
88-
#> Resets in: 49 minutes
87+
#> Remaining: 4224
88+
#> Resets in: 43 minutes
8989
```
9090

9191

@@ -100,22 +100,22 @@ gists(per_page = 2)
100100

101101
```
102102
#> [[1]]
103-
#> <gist>9a61e3d5b74722824309
104-
#> URL: https://gist.github.com/9a61e3d5b74722824309
105-
#> Description: FunctionSet model for Chainer based Convolutional Denoising Autoencoder
103+
#> <gist>4baa80440a1e0cdb4b195872762c6251
104+
#> URL: https://gist.github.com/4baa80440a1e0cdb4b195872762c6251
105+
#> Description: Elimination (PuzzleScript Script)
106106
#> Public: TRUE
107-
#> Created/Edited: 2015-07-03T00:20:15Z / 2015-07-03T00:20:16Z
108-
#> Files: conv_dae.py
109-
#> Truncated?: FALSE
107+
#> Created/Edited: 2019-07-18T17:39:06Z / 2019-07-18T17:39:06Z
108+
#> Files: readme.txt, script.txt
109+
#> Truncated?: FALSE, FALSE
110110
#>
111111
#> [[2]]
112-
#> <gist>4ae08d3a0bc3ac4862da
113-
#> URL: https://gist.github.com/4ae08d3a0bc3ac4862da
114-
#> Description: Bootstrap Customizer Config
112+
#> <gist>9f15e4d4c5f02b56cc634c31dd9f4153
113+
#> URL: https://gist.github.com/9f15e4d4c5f02b56cc634c31dd9f4153
114+
#> Description: rubberduck v1.4.3 - Passed - Package Tests Results
115115
#> Public: TRUE
116-
#> Created/Edited: 2015-07-03T00:19:29Z / 2015-07-03T00:19:29Z
117-
#> Files: config.json
118-
#> Truncated?: FALSE
116+
#> Created/Edited: 2019-07-18T17:39:05Z / 2019-07-18T17:39:06Z
117+
#> Files: 1.RegistrySnapshot.xml, FilesSnapshot.xml, Install.txt, Uninstall.txt, _Summary.md
118+
#> Truncated?: FALSE, FALSE, FALSE, FALSE, FALSE
119119
```
120120

121121
Since a certain date/time
@@ -127,22 +127,22 @@ gists(since = '2014-05-26T00:00:00Z', per_page = 2)
127127

128128
```
129129
#> [[1]]
130-
#> <gist>9a61e3d5b74722824309
131-
#> URL: https://gist.github.com/9a61e3d5b74722824309
132-
#> Description: FunctionSet model for Chainer based Convolutional Denoising Autoencoder
130+
#> <gist>4baa80440a1e0cdb4b195872762c6251
131+
#> URL: https://gist.github.com/4baa80440a1e0cdb4b195872762c6251
132+
#> Description: Elimination (PuzzleScript Script)
133133
#> Public: TRUE
134-
#> Created/Edited: 2015-07-03T00:20:15Z / 2015-07-03T00:20:16Z
135-
#> Files: conv_dae.py
136-
#> Truncated?: FALSE
134+
#> Created/Edited: 2019-07-18T17:39:06Z / 2019-07-18T17:39:06Z
135+
#> Files: readme.txt, script.txt
136+
#> Truncated?: FALSE, FALSE
137137
#>
138138
#> [[2]]
139-
#> <gist>4ae08d3a0bc3ac4862da
140-
#> URL: https://gist.github.com/4ae08d3a0bc3ac4862da
141-
#> Description: Bootstrap Customizer Config
139+
#> <gist>9f15e4d4c5f02b56cc634c31dd9f4153
140+
#> URL: https://gist.github.com/9f15e4d4c5f02b56cc634c31dd9f4153
141+
#> Description: rubberduck v1.4.3 - Passed - Package Tests Results
142142
#> Public: TRUE
143-
#> Created/Edited: 2015-07-03T00:19:29Z / 2015-07-03T00:19:29Z
144-
#> Files: config.json
145-
#> Truncated?: FALSE
143+
#> Created/Edited: 2019-07-18T17:39:05Z / 2019-07-18T17:39:06Z
144+
#> Files: 1.RegistrySnapshot.xml, FilesSnapshot.xml, Install.txt, Uninstall.txt, _Summary.md
145+
#> Truncated?: FALSE, FALSE, FALSE, FALSE, FALSE
146146
```
147147

148148
Request different types of gists, one of public, minepublic, mineall, or starred.
@@ -154,21 +154,21 @@ gists('minepublic', per_page = 2)
154154

155155
```
156156
#> [[1]]
157-
#> <gist>4fd5a913e911ad70098c
158-
#> URL: https://gist.github.com/4fd5a913e911ad70098c
157+
#> <gist>52f6dab219e0f2ca3f71cf70cafa11a3
158+
#> URL: https://gist.github.com/52f6dab219e0f2ca3f71cf70cafa11a3
159159
#> Description:
160160
#> Public: TRUE
161-
#> Created/Edited: 2015-07-03T00:19:18Z / 2015-07-03T00:19:22Z
162-
#> Files: code.R
161+
#> Created/Edited: 2019-04-24T16:38:20Z / 2019-04-24T16:38:43Z
162+
#> Files: crul-eg.R
163163
#> Truncated?: FALSE
164164
#>
165165
#> [[2]]
166-
#> <gist>974fd41ff30de9814cc1
167-
#> URL: https://gist.github.com/974fd41ff30de9814cc1
168-
#> Description: a new cool gist
166+
#> <gist>79507e3c5b905f605648797d849c1126
167+
#> URL: https://gist.github.com/79507e3c5b905f605648797d849c1126
168+
#> Description:
169169
#> Public: TRUE
170-
#> Created/Edited: 2015-07-03T00:19:18Z / 2015-07-03T00:19:18Z
171-
#> Files: stuff.md
170+
#> Created/Edited: 2019-02-22T20:31:58Z / 2019-02-22T20:31:58Z
171+
#> Files: classification_munging.md
172172
#> Truncated?: FALSE
173173
```
174174

@@ -185,7 +185,7 @@ gist(id = 'f1403260eb92f5dfa7e1')
185185
#> URL: https://gist.github.com/f1403260eb92f5dfa7e1
186186
#> Description: Querying bitly from R
187187
#> Public: TRUE
188-
#> Created/Edited: 2014-10-15T20:40:12Z / 2014-10-15T21:54:29Z
188+
#> Created/Edited: 2014-10-15T20:40:12Z / 2015-08-29T14:07:43Z
189189
#> Files: bitly_r.md
190190
#> Truncated?: FALSE
191191
```
@@ -212,11 +212,11 @@ gist_create(files = stuffpath, description = 'a new cool gist', browse = FALSE)
212212
```
213213

214214
```
215-
#> <gist>f6d0df13305a082f5247
216-
#> URL: https://gist.github.com/f6d0df13305a082f5247
215+
#> <gist>9984709a30889023bd79e489a7d50860
216+
#> URL: https://gist.github.com/9984709a30889023bd79e489a7d50860
217217
#> Description: a new cool gist
218218
#> Public: TRUE
219-
#> Created/Edited: 2015-07-03T00:20:27Z / 2015-07-03T00:20:27Z
219+
#> Created/Edited: 2019-07-18T17:39:09Z / 2019-07-18T17:39:09Z
220220
#> Files: stuff.md
221221
#> Truncated?: FALSE
222222
```
@@ -235,11 +235,11 @@ numbers
235235
```
236236

237237
```
238-
#> <gist>f80330754db203f8bb03
239-
#> URL: https://gist.github.com/f80330754db203f8bb03
238+
#> <gist>46b8f33a29f14f7c71fc409020cd6e43
239+
#> URL: https://gist.github.com/46b8f33a29f14f7c71fc409020cd6e43
240240
#> Description:
241241
#> Public: TRUE
242-
#> Created/Edited: 2015-07-03T00:20:27Z / 2015-07-03T00:20:27Z
242+
#> Created/Edited: 2019-07-18T17:39:11Z / 2019-07-18T17:39:11Z
243243
#> Files: code.R
244244
#> Truncated?: FALSE
245245
```
@@ -285,11 +285,11 @@ run(file, knitopts = list(quiet = TRUE)) %>% gist_create(browse = FALSE)
285285
```
286286

287287
```
288-
#> <gist>f6214845b1f64dac34e9
289-
#> URL: https://gist.github.com/f6214845b1f64dac34e9
288+
#> <gist>43b3e21059b86fef954eb08a3d3286ee
289+
#> URL: https://gist.github.com/43b3e21059b86fef954eb08a3d3286ee
290290
#> Description:
291291
#> Public: TRUE
292-
#> Created/Edited: 2015-07-03T00:20:27Z / 2015-07-03T00:20:27Z
292+
#> Created/Edited: 2019-07-18T17:39:13Z / 2019-07-18T17:39:13Z
293293
#> Files: stuff.md
294294
#> Truncated?: FALSE
295295
```
@@ -323,10 +323,10 @@ gists()[[1]] %>% commits()
323323
```
324324
#> [[1]]
325325
#> <commit>
326-
#> Version: aa6fd931a73dee814401790c0367ac672711d975
327-
#> User: sckott
328-
#> Commited: 2015-07-03T00:20:27Z
329-
#> Commits [total, additions, deletions]: [5,5,0]
326+
#> Version: 470b3fbdf638a083ede94d7ae7fd42f0560180dd
327+
#> User: ereastman616
328+
#> Commited: 2019-07-18T17:39:13Z
329+
#> Commits [total, additions, deletions]: [123,123,0]
330330
```
331331

332332
## Star a gist
@@ -335,34 +335,34 @@ Star
335335

336336

337337
```r
338-
gist('7ddb9810fc99c84c65ec') %>% star()
338+
gist('b564093d359eb735138a97258d03f333') %>% star()
339339
```
340340

341341
```
342-
#> <gist>7ddb9810fc99c84c65ec
343-
#> URL: https://gist.github.com/7ddb9810fc99c84c65ec
342+
#> <gist>b564093d359eb735138a97258d03f333
343+
#> URL: https://gist.github.com/b564093d359eb735138a97258d03f333
344344
#> Description:
345345
#> Public: TRUE
346-
#> Created/Edited: 2014-06-27T17:50:37Z / 2015-07-03T00:19:20Z
347-
#> Files: code.R, manifest.yml, rrt_manifest.yml
348-
#> Truncated?: FALSE, FALSE, FALSE
346+
#> Created/Edited: 2018-10-03T19:07:37Z / 2018-10-03T19:07:37Z
347+
#> Files: rcrossref-references.md
348+
#> Truncated?: FALSE
349349
```
350350

351351
Unstar
352352

353353

354354
```r
355-
gist('7ddb9810fc99c84c65ec') %>% unstar()
355+
gist('b564093d359eb735138a97258d03f333') %>% unstar()
356356
```
357357

358358
```
359-
#> <gist>7ddb9810fc99c84c65ec
360-
#> URL: https://gist.github.com/7ddb9810fc99c84c65ec
359+
#> <gist>b564093d359eb735138a97258d03f333
360+
#> URL: https://gist.github.com/b564093d359eb735138a97258d03f333
361361
#> Description:
362362
#> Public: TRUE
363-
#> Created/Edited: 2014-06-27T17:50:37Z / 2015-07-03T00:20:29Z
364-
#> Files: code.R, manifest.yml, rrt_manifest.yml
365-
#> Truncated?: FALSE, FALSE, FALSE
363+
#> Created/Edited: 2018-10-03T19:07:37Z / 2019-07-18T17:39:15Z
364+
#> Files: rcrossref-references.md
365+
#> Truncated?: FALSE
366366
```
367367

368368
## Update a gist
@@ -384,11 +384,11 @@ gists(what = "minepublic")[[1]] %>%
384384
```
385385

386386
```
387-
#> <gist>f80330754db203f8bb03
388-
#> URL: https://gist.github.com/f80330754db203f8bb03
387+
#> <gist>46b8f33a29f14f7c71fc409020cd6e43
388+
#> URL: https://gist.github.com/46b8f33a29f14f7c71fc409020cd6e43
389389
#> Description:
390390
#> Public: TRUE
391-
#> Created/Edited: 2015-07-03T00:20:27Z / 2015-07-03T00:20:29Z
391+
#> Created/Edited: 2019-07-18T17:39:11Z / 2019-07-18T17:39:16Z
392392
#> Files: alm.md, code.R
393393
#> Truncated?: FALSE, FALSE
394394
```
@@ -403,11 +403,11 @@ gists(what = "minepublic")[[1]] %>%
403403
```
404404

405405
```
406-
#> <gist>f80330754db203f8bb03
407-
#> URL: https://gist.github.com/f80330754db203f8bb03
406+
#> <gist>46b8f33a29f14f7c71fc409020cd6e43
407+
#> URL: https://gist.github.com/46b8f33a29f14f7c71fc409020cd6e43
408408
#> Description:
409409
#> Public: TRUE
410-
#> Created/Edited: 2015-07-03T00:20:27Z / 2015-07-03T00:20:30Z
410+
#> Created/Edited: 2019-07-18T17:39:11Z / 2019-07-18T17:39:18Z
411411
#> Files: code.R
412412
#> Truncated?: FALSE
413413
```
@@ -429,7 +429,7 @@ gists()[[1]] %>% embed()
429429
```
430430

431431
```
432-
#> [1] "<script src=\"https://gist.github.com/sckott/f80330754db203f8bb03.js\"></script>"
432+
#> [1] "<script src=\"https://gist.github.com/ereastman616/edbc570a99738505d4eef196e4ae7cba.js\"></script>"
433433
```
434434

435435
### List forks
@@ -447,7 +447,7 @@ gist(id = '1642874') %>% forks(per_page = 2)
447447
#> URL: https://gist.github.com/1642989
448448
#> Description: Spline Transition
449449
#> Public: TRUE
450-
#> Created/Edited: 2012-01-19T21:45:20Z / 2015-06-11T19:40:48Z
450+
#> Created/Edited: 2012-01-19T21:45:20Z / 2019-04-30T00:23:48Z
451451
#> Files:
452452
#> Truncated?:
453453
#>
@@ -456,7 +456,7 @@ gist(id = '1642874') %>% forks(per_page = 2)
456456
#> URL: https://gist.github.com/1643051
457457
#> Description: Line Transition (Broken)
458458
#> Public: TRUE
459-
#> Created/Edited: 2012-01-19T21:51:30Z / 2015-06-11T19:40:48Z
459+
#> Created/Edited: 2012-01-19T21:51:30Z / 2018-09-29T06:16:06Z
460460
#> Files:
461461
#> Truncated?:
462462
```
@@ -472,18 +472,18 @@ g <- gists()
472472
```
473473

474474
```
475-
#> <gist>9eff44494c12fcbc8590
476-
#> URL: https://gist.github.com/9eff44494c12fcbc8590
475+
#> <gist>8f9f96b67c67fd4a3a6b352674f95602
476+
#> URL: https://gist.github.com/8f9f96b67c67fd4a3a6b352674f95602
477477
#> Description:
478478
#> Public: TRUE
479-
#> Created/Edited: 2015-07-03T00:20:31Z / 2015-07-03T00:20:31Z
480-
#> Files: gistfile1.txt, gistfile2.txt
481-
#> Truncated?: FALSE, FALSE
479+
#> Created/Edited: 2019-07-18T17:39:22Z / 2019-07-18T17:39:22Z
480+
#> Files: gistfile1.txt
481+
#> Truncated?: FALSE
482482
```
483483

484484

485485

486-
## Example use case
486+
## Example use cases
487487

488488
_Working with the Mapzen Pelias geocoding API_
489489

@@ -507,3 +507,38 @@ gist_create(code = json, filename = "pelias_test.geojson")
507507
And here's that gist: [https://gist.github.com/sckott/017214637bcfeb198070](https://gist.github.com/sckott/017214637bcfeb198070)
508508

509509
![](img/gistr_ss.png)
510+
511+
_Round-trip storage of a data frame_
512+
513+
Maybe you want to use a gist to share some data as an alternative to `dput`? We can do this by writing our `data.frame` to a temporary buffer and passing it to `gist_create`. We can read the data back from the gist by passing its content to `read.csv`.
514+
515+
516+
```r
517+
data(iris)
518+
519+
str <- ''
520+
tc <- textConnection('str', 'w', local = TRUE)
521+
write.csv(iris, file = tc, row.names = FALSE)
522+
close(tc)
523+
524+
content <- list(content=paste(as.character(str), collapse='\n'))
525+
526+
gistr::gist_create(code = {
527+
content$content
528+
}, description = "using a gist as a data store",
529+
filename = "iris.csv")
530+
#> <gist>c7dfe593f4944df4818df884689734f9
531+
#> URL: https://gist.github.com/c7dfe593f4944df4818df884689734f9
532+
#> Description: using a gist as a data store
533+
#> Public: TRUE
534+
#> Created/Edited: 2019-07-18T14:23:23Z / 2019-07-18T14:23:23Z
535+
#> Files: iris.csv
536+
#> Truncated?: FALSE
537+
538+
output <- read.csv(
539+
text = gist(gists(what = "minepublic", per_page = 1)[[1]]$id)$
540+
files$iris.csv$content)
541+
542+
identical(output, iris)
543+
#> TRUE
544+
```

0 commit comments

Comments
 (0)