Skip to content

Instantly share code, notes, and snippets.

View z3tt's full-sized avatar
👨‍💻
Coding at home

Cédric Scherer z3tt

👨‍💻
Coding at home
View GitHub Profile
@lopspower
lopspower / README.md
Last active May 24, 2024 10:48
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@parmentf
parmentf / GitCommitEmoji.md
Last active May 24, 2024 00:27
Git Commit message Emoji
@tylermorganwall
tylermorganwall / submarine_cable_map.R
Last active April 19, 2024 07:36
Submarine Cable Map Dataviz
library(geojsonsf)
library(sf)
library(rayrender)
#Data source: https://github.com/telegeography/www.submarinecablemap.com
cables = geojson_sf("cable-geo.json")
cablescene = list()
counter = 1
for(i in 1:length(cables$geometry)) {
@joshua-feldman
joshua-feldman / prepend_functions.R
Last active February 11, 2024 13:24
Prepend all functions in an R script with package name
# Load the relevant packages
library(NCmisc)
library(stringr)
# Load the script and parse lines
file_name <- "example_script.R"
file_lines <- readLines(file_name)
# Save the function and package names
functions_list <- list.functions.in.file(file_name)
@jsta
jsta / zenodo.R
Created March 11, 2019 00:46
Download files from Zenodo record id
#' Download files from Zenodo record id
#'
#' @param record_id record id
#' @param dest_folder destination folder for file downloads
#' @param token API key
#'
#' @details https://github.com/zenodo/zenodo/issues/1629#issuecomment-435062462
#'
#' @importFrom httr GET content
#' @importFrom jsonlite fromJSON
@fzenoni
fzenoni / ortho_view.R
Last active November 2, 2023 11:06
Preserve polygons in orthographic view
# Download earth data first
# https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_land.zip
library(sf)
library(lwgeom)
library(dplyr)
library(ggplot2)
library(mapview)
# Read the data
@steveharoz
steveharoz / ggdist psychometric functions.R
Last active September 28, 2021 07:44
ggdist psychometric functions
library(tidyverse)
library(ggdist)
# make some data
expand_grid(
condition = c("A", "B"),
stimulus = seq(-3,3,0.3),
repetitions = 1:20
) %>%
# make some noisy response data
library(tidyverse)
library(ggsankey)
## data via https://ourworldindata.org/grapher/total-agricultural-area-over-the-long-term
hablar::set_wd_to_script_path()
df <-
read_csv("total-agricultural-area-over-the-long-term.csv") %>%
janitor::clean_names() %>%
@maartenzam
maartenzam / readme.md
Created October 22, 2017 20:25
World Tile Grid Map in ggplot2
@pr130
pr130 / clean_dkb_data.Rmd
Created October 10, 2020 13:37
Clean csvs exported from DKB online banking
---
title: "DKB Export Cleanup"
author: "Frie"
date: "10/10/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(purrr)