Skip to content

Instantly share code, notes, and snippets.

View nathancday's full-sized avatar

Nathan (Nate) Day nathancday

View GitHub Profile
@eribeiro
eribeiro / search_relevance_evaluation_metric.py
Last active August 21, 2022 13:20
Search relevance evaluation metrics
##
## Python implementations of the search relevance evaluation metrics described at
## https://opensourceconnections.com/blog/2020/02/28/choosing-your-search-relevance-metric/
##
##
def precision(docs):
return sum(docs) / len(docs) if docs else 0
def avg_precision(docs):
@gadenbuie
gadenbuie / join-animations-with-gganimate.R
Last active January 11, 2022 15:48
Animated dplyr joins with gganimate
# Animated dplyr joins with gganimate
# * Garrick Aden-Buie
# * garrickadenbuie.com
# * MIT License: https://opensource.org/licenses/MIT
# Note: I used Fira Sans and Fira Mono fonts.
# Use search and replace to use a different font if Fira is not available.
library(tidyverse)
library(gganimate)
@alferov
alferov / docker-rm-images.md
Last active July 24, 2023 08:33
Remove all (untagged) images and containers from Docker
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")

References:

# make a nice viridis GMRF tesselation for Richard
rm(list = ls())
set.seed(1)
library(INLA)
library(raster)
library(viridis)
library(fields)
# grid sizes for sampling the GRF and for the final image
@Quiri
Quiri / server.R
Created September 9, 2014 10:05
Shiny disable checkbox minimal example
library(shiny)
shinyServer(function(input, output, session) {
observe({
if(input$tv == "All, but C") {
updateCheckboxGroupInput(session, "check2", label = NULL, choices = NULL,
selected = c("A", "B", "D", "E"))
}
if(input$tv == "Only C or D") {