Skip to content

Instantly share code, notes, and snippets.

View danieltomasz's full-sized avatar

Daniel Borek danieltomasz

View GitHub Profile
@danieltomasz
danieltomasz / Example.r
Created January 29, 2023 23:07
Iterating over variables in glm
create_models <- function(datame_name, cog_vars, eeg_components) {
list_models <- list()
for (cogvar in cog_vars) { # ,eeg_components
for (eegvar in eeg_components) { # ,eeg_components
models <- glue("model1.{cogvar}.{eegvar} <- glm({cogvar} ~ GM_Normalised + {eegvar}, {datame_name}, family = gaussian)
list_models[['model.{cogvar}.{eegvar}']] <- model5.{cogvar}.{eegvar}") # nolint
eval(str2expression(models))
}
}
return(list_models)
@danieltomasz
danieltomasz / clearwiki.md
Last active September 14, 2022 22:26
A naive proof of the concept Lua filter removing wikilinks

A naive proof of the concept Lua filter for removing [[ wikilinks from markdown file.

function Str (str)
    return (str.text:gsub('%[%[', '')
                    :gsub('%]%]', ''))
end

When the filter is saved under name cleanwiki.lua it might be used with the flag --lua-filter=cleanwiki.lua

@danieltomasz
danieltomasz / dplyr_function_quote_filter.md
Last active March 27, 2022 22:00
This gist is showing how to properly use filter argument in quote in function written around dplyr pipes

Code for reproducible example around github functions

library(stringi)
library(tidyr)
library(dplyr)
library(stringr)

example <- data.frame(LP=1:10000)  %>%
  rowwise() %>%
@danieltomasz
danieltomasz / vscode_shortcuts.md
Created June 18, 2021 14:27 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

reproducible pipeline with pyenv

pyenv install  3.8.10
pyenv virtualenv 3.8.10 example-env-name
pyenv local cognitive-reserve
@danieltomasz
danieltomasz / ColorAnnotation.py
Last active June 9, 2021 15:36
This Python script will replace html with Zotero annotation with more Obsidian friendly that display the color in the preview
#!/usr/bin/env python
# # -*- coding: utf-8 -*-
# %%
import urllib, json
import json
import re
import urllib.parse
from colormap import hex2rgb
import argparse
@danieltomasz
danieltomasz / Agile Academia OpenMR 2021.md
Last active March 25, 2021 14:16
Presentation Agile Academia OpenMR 2021

What is Agile

Agile Software Development

  • Individuals and interactions over processes and tools
  • Working software over comprehensive documentation
  • Customer collaboration over contract negotiation
  • Responding to change over following a plan

Kanban

@danieltomasz
danieltomasz / Example.py
Created March 11, 2021 20:39
File to play with long and wide format
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.10.3
# kernelspec:
# display_name: Python 3.8.7 64-bit
@danieltomasz
danieltomasz / Makefile.dash
Last active September 24, 2020 18:09 — forked from wcooley/Makefile.dash
Building 3rd Party Sphinx Docs for Dash
# docs/Makefile.dash
include Makefile
SPHINXBUILD = sphinx-build
BUILDDIR = $(shell pwd)
PROJECT_NAME = "mne"
.PHONY: dashdoc
dashdoc:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) -D 'html_theme=epub' $(BUILDDIR)/dashdoc
doc2dash -A -v -n $(PROJECT_NAME) -d $(BUILDDIR)/ -f -I index.html -j $(BUILDDIR)/dashdoc
@echo
@danieltomasz
danieltomasz / i3-gaps_installation_guide.md
Created March 8, 2019 12:36 — forked from boreycutts/i3-gaps_installation_guide.md
A simple installation guide for i3-gaps

Installing i3-gaps

Dependencies

i3-gaps has some packages that are required for it to work so install these things:

sudo apt install libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf xutils-dev libtool automake

You also need to install libxcb-xrm-dev, but I got Unable to locate package libxcb-xrm-dev when trying to install from the apt repositories on Ubuntu 16.04. If this happens to you, just install it from source using these commands:

mkdir tmp