Skip to content

Instantly share code, notes, and snippets.

View mslw's full-sized avatar

Michał Szczepanik mslw

View GitHub Profile
@mslw
mslw / .zshrc
Last active November 29, 2022 10:58
A fairly minimal .zshrc file, with https://github.com/sindresorhus/pure prompt. Patchworked from my personal config, autogenerated bits, and some snippets. Made for setting up zsh on JupyterHub.
# Set up the prompt
fpath+=($HOME/.zsh/pure)
autoload -Uz promptinit
promptinit
prompt pure
setopt histignorealldups sharehistory
# Use emacs keybindings even if our EDITOR is set to vi
@mslw
mslw / create-font-specimen.py
Created June 26, 2022 17:42
A quick way of generating font samples in svg
import svgwrite
# Catppuccin frappe, see https://github.com/catppuccin/catppuccin
base = svgwrite.rgb(48, 52, 70)
text = svgwrite.rgb(198, 208, 245)
blue = svgwrite.rgb(140, 170, 238)
green = svgwrite.rgb(166, 209, 137)
red = svgwrite.rgb(231, 130, 132)
fs_big=50
@mslw
mslw / init.el
Last active January 11, 2024 20:29
the current state of my emacs config on the laptop
;;; Package sources
(require 'package)
(if (version< emacs-version "28")
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/") t))
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)
;; Prefer melpa stable (maybe that's too conservative)
(setq package-archive-priorities
'(("gnu" . 20)
@mslw
mslw / read_event_table
Last active November 3, 2019 16:50
Reading BIDS events.tsv into matlab table
function [event_table] = read_event_table(file_path)
%READ_EVENT_TABLE Read BIDS events file into a table
% Reads trial_type, onset and duration columns from BIDS events.tsv file.
% Returns a matlab table. The trial_type column is converted into a
% string array, so that it can be conveniently queried with:
% mytable(mytable.trial_type == 'something', :).
% straight up readtable won't work with .tsv file extension
estruct = tdfread(file_path);