Skip to content

Instantly share code, notes, and snippets.

View lgatto's full-sized avatar

Laurent Gatto lgatto

View GitHub Profile
@ajstewartlang
ajstewartlang / gist:89dcdf01c4512a213141a16e9243626d
Last active November 24, 2023 21:15
Hacked together code for animated raincloud plots for N=20 and N=500 where no difference exists in underlying populations
# Usimg @micahgallen's nice raincloud plot code
# https://wellcomeopenresearch.org/articles/4-63
# and fork of benmarwick/geom_flat_violin.R code
# gganimate by Thomas Lin Pedersen - @thomasp85
devtools::install_github('thomasp85/gganimate')
library(tidyverse)
library(gganimate)
library(RColorBrewer)
@adamhsparks
adamhsparks / ftp_file_list.R
Last active May 10, 2024 11:04
list ftp site files using {curl} (not {RCurl}) in R
ftp_base <- "ftp://"
list_files <- curl::new_handle()
curl::handle_setopt(list_files, ftp_use_epsv = TRUE, dirlistonly = TRUE)
con <- curl::curl(url = ftp_base, "r", handle = list_files)
files <- readLines(con)
close(con)
@sgibb
sgibb / memstat.sh
Created January 22, 2017 16:55
monitor synapter memory usage
#!/bin/sh
PROCESSPID=${1}
pidstat -urIh -p ${PROCESSPID} 1 1 | grep -v "^Linux\|^ *$" > memstat.txt && pidstat -urIh -p ${PROCESSPID} 60 | grep -v "^#\|^ *$\|^Linux" | tee -a memstat.txt
@rasmusab
rasmusab / fuzzycolor.R
Created June 18, 2016 10:11
A function that takes a vector of color names and matches it against the xkcdcolors list of color names using edit distance.
# fuzzycolor() takes a vector of color names and matches it against the
# xkcdcolors list of color names using edit distance. fuzzycolor() always
# returns a vector of hex color strings, perhaps the ones you wanted...
fuzzycolor <- function(color_names) {
library(xkcdcolors)
names_distance <- adist(color_names, xcolors(), ignore.case = TRUE, partial = TRUE)
xkcd_colors <- xcolors()[ apply(names_distance, 1, which.min) ]
hex_colors <- name2color(xkcd_colors)
names(hex_colors) <- xkcd_colors
hex_colors
@drjwbaker
drjwbaker / 2016-03-21_CW16.md
Last active March 30, 2016 12:52
Software Sustainability Institute Collaborations Workship 2016, Edinburgh, 21-22 March

Software Sustainability Institute Collaborations Workship 2016, Edinburgh, 21-22 March

Live notes, so an incomplete, partial record of what actually happened.

Tags: collabw16

My asides in {}

Stream/Deck:

@sje30
sje30 / .emacs.el
Last active June 4, 2020 06:35
makefile-eval-current-target
;; This is inspired by Org mode: hitting C-c C-c inside a Makefile
;; rule will run "make TARGET" where TARGET is the name of the current
;; target at point.
;; Stephen Eglen 2016-01-31 GPL applies.
(defun makefile-eval-current-target ()
"Evaluate the current Makefile rule in a *Compile* buffer."
(interactive)
(let ((target (makefile-add-log-defun)))
(if (null target)
@lcolladotor
lcolladotor / experiment-data: derfinderData example
Last active January 30, 2020 18:19
Code for adding Bioconductor shields
<a href="http://bioconductor.org/packages/stats/bioc/derfinderData.html"><img border="0" src="http://www.bioconductor.org/shields/downloads/derfinderData.svg" title="Percentile (top 5/20/50% or 'available') of downloads over last 6 full months. Comparison is done across all package categories (software, annotation, experiment)."></a> <a href="https://support.bioconductor.org/t/derfinderData/"><img border="0" src="http://www.bioconductor.org/shields/posts/derfinderData.svg" title="Support site activity, last 6 months: tagged questions/avg. answers per question/avg. comments per question/accepted answers, or 0 if no tagged posts."></a> <a href="http://www.bioconductor.org/packages/release/data/experiment/html/derfinderData.html#svn_source"><img border="0" src="http://www.bioconductor.org/shields/commits/data-experiment/derfinderData.svg" title="average Subversion commits (to the devel branch) per month for the last 6 months"></a>
Status: Bioc-release <a href="http://www.bioconductor.org/packages/release/data/e
@Jfortin1
Jfortin1 / darken.R
Last active September 2, 2023 20:42
Darken or lighten colors in R
darken <- function(color, factor=1.4){
col <- col2rgb(color)
col <- col/factor
col <- rgb(t(col), maxColorValue=255)
col
}
lighten <- function(color, factor=1.4){
col <- col2rgb(color)
[include]
# For user/credentials/token/etc
path = ~/.gitconfig.local
[core]
editor = vim
excludesfile = ~/.gitignore
[color]
branch = auto
diff = auto
status = auto