Skip to content

Instantly share code, notes, and snippets.

View jacob-ogre's full-sized avatar

Jacob Malcom jacob-ogre

View GitHub Profile
@jeroen
jeroen / cranscraper.R
Last active January 17, 2021 17:15
Fast scraping of package metadata using curl multi API
# Globals
repos <- 'https://cloud.r-project.org'
pkgdata <- available.packages(repos = repos)
pkgs <- row.names(pkgdata)
# On success
make_callback <- function(i, url){
function(res){
if(res$status == 200){
buf <- rawConnection(res$content)
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@xiaodaigh
xiaodaigh / server.r
Last active February 2, 2016 18:07
R Shiny: An textInput that only gets invalidated upon losing focus or when enter is pressed shiny::runGist("7150112")
library(shiny)
shinyServer(function(input, output, session) {
# Partial example
output$meh <- renderPrint({
print("Press enter or focusout to update --- ")
print(input$myTextInput )