- Do you have an Github account ? If not create one.
- Install required tools
- Latest Git Client
- gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
| #!/bin/bash | |
| USERNAME=`whoami` | |
| PASSWORD=`pass github` | |
| set -euo pipefail | |
| REPOSITORIES=$(curl \ | |
| --user ${USERNAME}:${PASSWORD} \ | |
| --silent \ |
Playing with adding + operator for easily joining geojson objects together into a single
valid geojson object. This is relatively easy with lists, but not so easy with json unless you speak json.
Get lawn package too for viewing data
devtools::install_github("ropensci/geojsonio")| ### Colours of old Smarties with lovely artificial colouring, derived from: | |
| ### | |
| ### | |
| ### "Smarties old new" by John Penton and Paul Hughes - Own work. Licensed under CC BY-SA 2.5 via Wikimedia Commons - https://commons.wikimedia.org/wiki/File:Smarties_old_new.jpg#mediaviewer/File:Smarties_old_new.jpg | |
| ### | |
| ### image was loaded into gimp, representative parts of each Smartie were isolated, the image converted to indexed palette | |
| ### with 9 colours, the palette then saved. | |
| ## | |
| ### "Smarties" is a trademark of Nestle | |
| ## |
What if a function in a package has no examples? Or is poorly exampled? Wouldn't it be nice to find functioning instances of it "in the wild"?
Via Twitter, Noam Ross taught me a clever way to do such searches on GitHub. Put this into the GitHub search box to see people using the llply() function from plyr:
"llply" user:cran language:ROr just click here.
Using the Google Elevation API at the following link https://developers.google.com/maps/documentation/elevation/
| # convert c("female", "Male") to c(0,1) | |
| # magrittr is way nicer than nested function calls | |
| convert_sexcodes <- | |
| function(codes) | |
| { | |
| require(magrittr) | |
| tolower(codes) %>% |
| # You should totally ignore this because it's the first piece of Julia I've ever written. | |
| # 2-clause BSD, blah. | |
| function make_cycle(n) | |
| result = Dict{Int32, Array{Int32}}() | |
| for i = 1:n | |
| ii = i - 1 | |
| push!(result, i, [1 + ((i+n-2) % n), 1 + i % n]) | |
| end | |
| result |