Skip to content

Instantly share code, notes, and snippets.

View izikeros's full-sized avatar

Krystian Safjan izikeros

View GitHub Profile
@izikeros
izikeros / simple_transformer.py
Created September 22, 2021 18:52 — forked from wassname/simple_transformer.py
Transformer in ~80 lines of code from Thomas Wolf's tweet https://twitter.com/Thom_Wolf/status/1129658539142766592
"""
Transformer in ~80 lines of code.
From Thomas Wolf's tweet https://twitter.com/Thom_Wolf/status/1129658539142766592.
"""
import torch
from torch import nn
class Transformer(nn.Module):
@izikeros
izikeros / exercise.md
Created September 22, 2021 18:49 — forked from wassname/exercise.md
exercise.md

Exercise

Description:

  1. first
  2. second
@izikeros
izikeros / pdshow.py
Created September 22, 2021 18:48 — forked from wassname/pdshow.py
show a pandas data frame in full
from IPython.display import display
import pandas as pd
def pdshow(df):
"""
This shows a pandas dataframe in full/
Also consider .to_html() and https://pbpython.com/dataframe-gui-overview.html
@izikeros
izikeros / script-template.sh
Last active March 14, 2024 10:08 — forked from m-radzikowski/script-template.sh
[safe bash script template] see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/ #bash #script #template
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@izikeros
izikeros / restic_backup.sh
Created March 31, 2021 07:52 — forked from zerodahero/restic_backup.sh
Restic backup with .gitignore style excludes
#!/bin/bash
TEMPFILE='/tmp/restic_ignores.txt'
BACKUPDIR=$HOME
# Note: Not sure which way is better, echo nothing into the file, or remove if exists
# if [ -f $TEMPFILE ]; then
# rm $TEMPFILE
# fi
# touch $TEMPFILE
@izikeros
izikeros / PKGBUILD
Created January 25, 2021 10:53 — forked from valeth/PKGBUILD
[archlinux] PKGBUILD template
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.
# Maintainer: Your Name <youremail@domain.com>
pkgname=NAME
pkgver=VERSION
pkgrel=1
epoch=
@izikeros
izikeros / stock-bankier.sh
Last active July 22, 2020 09:06
Get stock and currency data from bankier.pl, supports multiple tickers at once | Notowania giełdowe GPW, ceny surowców, ceny walut | CLI
#!/bin/bash
# stock-bankier.sh
# Getting stock, some currency data from bankier.pl
# Supported currency: EUR, USD
#
# usage:
# ./stock-bankier.sh ticker
# sample tickers:
# MERCATOR
# WIG20
@izikeros
izikeros / bankier.sh
Created July 22, 2020 07:50
Get stock data from bankier.pl, supports multiple tickers at once | Notowania giełdowe GPW | CLI
#!/bin/bash
# bankier.sh
# Getting stock data from bankier.pl
#
# usage:
# ./bankier.sh ticker
# sample tickers:
# WIG
# WIG20
# mWIG40
@izikeros
izikeros / Useful_Nim_Lang_snippets.md
Last active April 28, 2020 07:49
Collection of useful snippets of nim code

pass a function as argument

pass mutable function argument with var

proc roster*(school: var School): seq[string] =

(Learned from exercism mentor)

expected error during test

@izikeros
izikeros / notebook_header.md
Last active July 18, 2024 07:07
[Notebook header] Informative header template for Jupyter notebook. Helpful to get quick orientation when working on multiple notebooks in wide range of time. #notebook #jupyter #header

Title of Notebook

Purpose:

  • describe what can be achieved with this notebook
  • what is the role of the notebook in relation to other notebooks in the project

Created by: Author Name

Jira: PROJ-230