Skip to content

Instantly share code, notes, and snippets.

sbos / HMM.jl
Created November 1, 2013 11:25
Hidden Markov Model in Julia
module HMM
using Distributions
import Distributions.rand
immutable HiddenMarkovModel{TP, K}
benmarwick / auto-install-and-load-packages.R
Last active February 21, 2021 01:20
A method to automatically download, install and load R packages that only requires the package name to be typed once. Credits: &
list.of.packages <- c("xx", "yy") # replace xx and yy with package names
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)
lapply(list.of.packages, require, character.only=T)
thugcee / sxhkdrc
Last active May 18, 2022 09:46 — forked from jpentland/
Suckless' tabbed integration with BSPWM. This configuration supports joining any two neighbouring windows into a new tabbed, removing windows from tabbed and when last window is from tabbed removed then tabbed instance is closed. This slightly modified `` allows to omit id of the removed window (the current one is removed by default).
# Remove current tab from tabbed
super + mod1 + t; r $(bspc query -N -n focused) remove
# At given direction: join two windows into a new tabbed or add window to an existing tabbed
super + mod1 + t; {Left,Down,Up,Right} $(bspc query -N -n {west,south,north,east}) add $(bspc query -N -n focused)
benmarwick / captions_and_crossrefs.rmd
Last active March 24, 2023 17:53
Auto-numbering and cross-referencing of figures and tables in rmarkdown
title: "Auto-numbering and cross-referencing of figures and tables in rmarkdown"
output: html_document
NOTE: I recommend using the bookdown package and `output: html_document2` to make captions and cross-references more easily than the method described below.
TODO: check this out:
Here's how to use:
konfou /
Created April 1, 2021 20:07
Fix gksqt error when plotting with Julia on NixOS

TL;DR Run, then nix-shell julia-fix-gksqt.nix --run julia.

If you're running NixOS and trying to plot something in Julia you're probably getting the following error (where kon will and 9Vi4m may differ)

sh: /home/kon/.julia/packages/GR/9Vi4m/src/../deps/gr/bin/gksqt: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application