Skip to content

Instantly share code, notes, and snippets.

View emanuelhuber's full-sized avatar

Emanuel Huber emanuelhuber

View GitHub Profile
@emanuelhuber
emanuelhuber / r2jekyll.R
Last active October 5, 2022 17:51
From Rmarkdown to github markdown while preserving latex equations
#!/usr/bin/env Rscript
#-----------------------------------------------------------------------------
# How to run?
# In terminal enter: Rscript --vanilla r2jekyll.R my_RMarkdownFile.Rmd
#-----------------------------------------------------------------------------
# Problem while rendering Rmarkdown files with latex equation into markdown file
# -> Rmarkdown try to convert the equation into markdown instead of leaving them
# as latex equation. In consequences, the equations within the mardown file
@JJediny
JJediny / gist:a466eed62cee30ad45e2
Created October 5, 2015 20:42
Jekyll Liquid Cheatsheet

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by
@johnbaums
johnbaums / polygonizer.R
Last active February 15, 2021 02:18
Convert raster data to a ESRI polygon shapefile and (optionally) a SpatialPolygonsDataFrame
polygonizer <- function(x, outshape=NULL, pypath=NULL, readpoly=TRUE,
fillholes=FALSE, aggregate=FALSE,
quietish=TRUE) {
# x: an R Raster layer, or the file path to a raster file recognised by GDAL
# outshape: the path to the output shapefile (if NULL, a temporary file will
# be created)
# pypath: the path to gdal_polygonize.py or OSGeo4W.bat (if NULL, the function
# will attempt to determine the location)
# readpoly: should the polygon shapefile be read back into R, and returned by
# this function? (logical)
@inequation
inequation / hdd2ssd-dualboot.md
Last active December 9, 2022 00:58
Guide to migrating a dual-boot Linux/Windows system to an SSD

Having painstakingly performed the operation of migrating dual-boot systems to SSDs (without a fresh install of any of the systems) twice in the recent days, I've decided to write the steps down in case I ever need to repeat it. It may also benefit someone else on the internet. This is the most efficient and least error-prone workflow to the best of my knowledge, and discovering it was not as easy as it may seem.

Please excuse the somewhat short-hand form of this guide; I take the liberty to assume the reader is a power-user and is at least familiar with Linux.

The scenario

Here are the specific conditions I worked under:

  • Dual-boot, Linux/Windows system.
  • MBR partition tables.