Skip to content

Instantly share code, notes, and snippets.

View ginolhac's full-sized avatar
🚲
graveling

Aurélien Ginolhac ginolhac

🚲
graveling
View GitHub Profile
@koncina
koncina / txtcol.R
Created September 16, 2016 06:35
Color text for Pdf or Html output
# From http://stackoverflow.com/a/37122306
txtcol <- function(x, color) {
outputFormat = knitr::opts_knit$get("rmarkdown.pandoc.to")
if (outputFormat == 'latex')
paste("\\textcolor{", color, "}{", x, "}", sep = "")
else if (outputFormat == 'html')
paste("<font color='", color, "'>", x, "</font>", sep = "")
else
x
}
@mjnaderi
mjnaderi / install-arch.md
Last active May 30, 2024 15:57 — forked from mattiaslundberg/arch-linux-install
Installing Arch Linux with Full Disk Encryption (LVM on LUKS)

Installing Arch Linux with Full Disk Encryption

If you're aiming for a seamless Arch Linux installation in UEFI mode, follow along as this guide will walk you through the process step by step. We'll be using LUKS (Linux Unified Key Setup) and LVM (Logical Volume Manager) partitions on LUKS to achieve full disk encryption.

Note: I have updated this doc for UEFI mode. For those with BIOS/MBR systems, you can refer to the previous version, but keep in mind that it might be outdated and no longer accurate.

If you're only interested in installing Linux and not setting up dual boot with Windows, feel free to skip the Windows-related sections.

@jimhester
jimhester / 0.9.3.png
Last active July 11, 2018 11:18
Run R code with different versions of package dependencies, this will work in the same session as long as you don't run into issues unloading the namespaces
0.9.3.png
library(tidyverse)
library(broom)
library(scales)
theme_set(theme_minimal())
crossing(n = round(10 ^ seq(1, 7, .1)),
delta = 10 ^ seq(-1, -3, -1),
sig.level = .05,
sd = .3) %>%
invoke(power.t.test, ., type = "one.sample") %>%
library(tidyverse)
library(lubridate)
library(emoGG)
lexie <- tribble( ~date, ~weight,
"2017-07-12", 3.460,
"2017-07-13", 3.200,
"2017-07-14", 3.100,
"2017-07-15", 3.200,
"2017-07-16", 3.250,
library(tidyverse)
data_frame(
x = 1:100,
y = rnorm(100)
) %>%
mutate( y_quartile = ntile(y, 4) ) %>%
head(5)
# # A tibble: 5 x 3
@clauswilke
clauswilke / Aus_athletes_cheeseplot.R
Last active June 24, 2018 17:21
Cheese plot of height and bodyfat % of Australian athletes
# original version
library(DAAG)
library(ggplot2)
library(ggridges)
ggplot(ais, aes(x=ht, y=sport, point_size=pcBfat, point_color=sex, group=sport)) +
geom_density_ridges(jittered_points=TRUE, scale = .8, rel_min_height = .01, fill = "gray90",
points_scaling_range = c(.1, .8)) +
scale_y_discrete(expand = c(.01, 0)) +
scale_x_continuous(expand = c(0, 0), name = "height [cm]") +
scale_point_size_continuous(range = c(0.1, 5), name = "% bodyfat") +
library(magick)
library(reshape2)
library(dplyr)
library(tidygraph)
library(particles)
library(animation)
plot_fun <- function(sim) {
df <- as_tibble(sim)
plot(df$x, df$y, col = df$color, pch = '.', axes = FALSE, xlim = c(-100, 317), ylim = c(-268, 100), xlab = NA, ylab = NA)
@gadenbuie
gadenbuie / gifify.sh
Last active September 18, 2019 17:25
Convert screencast mov to gif
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=6,scale=720:-1:flags=bicubic"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2