Skip to content

Instantly share code, notes, and snippets.

View marskar's full-sized avatar
👨‍💻
Per aspera💪ad astra✨

Martin Skarzynski marskar

👨‍💻
Per aspera💪ad astra✨
View GitHub Profile
@marskar
marskar / ProgrammaticNotebook.ipynb
Created September 16, 2017 16:01 — forked from fperez/ProgrammaticNotebook.ipynb
Creating an IPython Notebook programatically
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marskar
marskar / app.R
Last active December 27, 2021 05:36
Shiny Old Faithful Geyser example with magrittr pipes
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
@marskar
marskar / pydy.py
Last active September 27, 2018 04:01
from importlib import import_module
def pydy(cls, src: str = 'helper'):
class Pydy(cls):
pass
mod = import_module(src)
internals = mod.__dict__.items()
@marskar
marskar / setup.R
Last active September 7, 2021 01:41
Create an R package using this script.
#' ---
#' title: "How to set up a project - R script"
#' author: "Martin Skarzynki"
#' date: "`r Sys.Date()`"
#' output:
#' html_document:
#' keep_md: true
#' ---
#'
#' # Step 1: Create a package/project
@marskar
marskar / pytest_ini.sh
Created December 9, 2018 18:21
Create a pytest.ini file
echo "[pytest]\naddopts = --mypy --mypy-ignore-missing-imports --doctest-modules" > pytest.ini
@marskar
marskar / auto_commit.py
Last active April 21, 2019 14:20
A super lazy commit
import git
repo = git.Repo()
untracked = repo.untracked_files
changed_file_lists = [
[file.a_path
for file in repo.index.diff(None).iter_change_type(change_type)]
for change_type in list('DMR')
@marskar
marskar / commit.py
Last active April 21, 2019 14:49
The ultimate lazy commit!
import git
repo = git.Repo()
untracked = repo.untracked_files
changed_file_lists = [
[file.a_path
for file in repo.index.diff(None).iter_change_type(change_type)]
for change_type in ('D', 'M')
@marskar
marskar / acmp.py
Last active April 21, 2019 15:02
ACMP stands for git add && git commit --message && git push
import git
repo = git.Repo()
untracked = repo.untracked_files
changed_file_lists = [
[file.a_path
for file in repo.index.diff(None).iter_change_type(change_type)]
for change_type in ('D', 'M')
@marskar
marskar / camp.py
Last active April 5, 2023 19:07
CAMP stands for git commit --add --message && git push
import git
repo = git.Repo()
changed_file_lists = [
[file.a_path
for file in repo.index.diff(None).iter_change_type(change_type)]
for change_type in ('D', 'M')
]
@marskar
marskar / acm.py
Created April 21, 2019 15:00
ACM stands for git add && git commit --message
import git
repo = git.Repo()
untracked = repo.untracked_files
changed_file_lists = [
[file.a_path
for file in repo.index.diff(None).iter_change_type(change_type)]
for change_type in ('D', 'M')