Skip to content

Instantly share code, notes, and snippets.

View danieltomasz's full-sized avatar

Daniel Borek danieltomasz

View GitHub Profile
@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 / 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 / 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

reproducible pipeline with pyenv

pyenv install  3.8.10
pyenv virtualenv 3.8.10 example-env-name
pyenv local cognitive-reserve
@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

@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 / 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 / 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)

Quarto callouts

About callouts

Callouts are a great way to add more attention ot certain details of the text (in the form of a box). Quarto provides 5 different types of callouts:

  • note
  • warning
  • important
@danieltomasz
danieltomasz / wikilinks-filter.lua
Last active August 19, 2023 14:00
Lua filter for removing wikilinks brackets