Skip to content

Instantly share code, notes, and snippets.

@italo-goncalves
italo-goncalves / google_elevation.R
Created September 15, 2017 00:08
R code to access the Google Elevation API. You will need a Google account and a developer key.
get_Google_Elevation <- function(lat, long, key){
# packages
require(httr)
require(jsonlite)
require(dplyr)
# setup
Ndata <- length(lat)
base_int <- 40 # max roughly 40 data points per request
Ncells <- ceiling(Ndata/base_int)
@joebrew
joebrew / get_data.R
Created August 4, 2017 16:35
Get lots of geographic activity data from the Strava API
library(tidyverse)
# https://github.com/fawda123/rStrava
library(rStrava)
library(yaml)
library(feather)
options(scipen = '999')
# Get access / authentication token for Strava's API
credentials <- yaml::yaml.load_file(input = 'credentials/credentials.yaml')
@rentrop
rentrop / graphql-example.R
Last active February 7, 2024 12:33
Querying GraphQL with R using httr
# Assuming the following GraphQL: https://github.com/calebmer/postgraphql/tree/master/examples/forum
# Deploy to AWS via https://github.com/rentrop/serverless-postgraphql
require(httr)
require(jsonlite)
# Define helper function --------------------------------------------------
url <- "https://your-endpoint/graphql"
GQL <- function(query,
@keeferrourke
keeferrourke / install-google-fonts.sh
Last active May 22, 2023 12:38
A bash script to install all Google Fonts, system wide, on debian based systems (ex. Ubuntu)
#!/bin/sh
# Written by: Keefer Rourke <https://krourke.org>
# Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git>
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git
sudo apt-get install fonts-cantarell ttf-ubuntu-font-family git
srcdir="/tmp/google-fonts"
pkgdir="/usr/share/fonts/truetype/google-fonts"
giturl="git://github.com/google/fonts.git"
@Ray901
Ray901 / Login.R
Last active May 15, 2021 00:23
R shiny app userLogin
#### Log in module ###
PASSWORD <- data.frame(
Brukernavn = c("ray","gil"),
Passord = c("0000","1234")
)
output$uiLogin <- renderUI({
if (USER$Logged == FALSE) {
wellPanel(