Skip to content

Instantly share code, notes, and snippets.

View piojanu's full-sized avatar

Piotr Januszewski piojanu

View GitHub Profile
@piojanu
piojanu / commit-msg
Created January 31, 2018 09:56
Checks for the presence of capitalised [TAG] at the beginning of commit message.
#!/bin/sh
#
# An hook script to check for the presence of capitalised [TAG]
# at the beginning of commit log message.
#
# To enable this hook localy in your repo, copy this code to
# "[...]/.git/hooks/commit-msg", remove "commit-msg.sample" if present
# and give "commit-msg" execute persmission. Enjoy!
# Regex to validate presence of [TAG] at the beginning of commit msg
@piojanu
piojanu / torchtrainer.py
Last active November 29, 2018 07:14
Minimalistic but whole high-level wrapper on PyTorch torch.nn.Module with Keras-like API for training and evaluation
"""The MIT License
Copyright 2018 Piotr Januszewski, Mateusz Jabłoński
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONN
@piojanu
piojanu / pre-commit
Last active March 27, 2019 09:34 — forked from Matioz/pre-commit
Applies autopep8 on all staged files and verify them with pycodestyle
#!/usr/bin/env python
from __future__ import with_statement, print_function
import os
import re
import shutil
import subprocess
import sys
import tempfile
@piojanu
piojanu / mnist_vae.py
Last active April 7, 2019 09:34
TensorFlow Probability MNIST VAE implementation using tf_utils (https://github.com/piojanu/tf_utils/blob/master/tf_utils/utils.py)
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tf_utils import AttrDict, lazy_property_with_scope
tfd = tfp.distributions
tfl = tf.layers
@piojanu
piojanu / .bash_aliases
Last active November 8, 2019 12:22
Bash aliases
alias p='python'
alias p3='python3'
alias ga='git add'
alias gci='git commit -m'
alias gcia='git commit -am'
alias gco='git checkout'
alias gh="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'"
alias gs='git status'
[alias]
unstage = reset HEAD --
info = show --name-only
detail = show --decorate=full
contains = log --source --all -G
co = checkout
ci = commit
st = status
br = branch
hist = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
@piojanu
piojanu / gist:1bd869340d180975dd36d2c24c3285de
Created November 5, 2020 00:49
Cannot run program "rdiff-backup world backups/world": error=2, No such file or directory
[01:31:35] [main/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', name='PROD'
[01:31:36] [main/INFO]: Reloading ResourceManager: Default, bukkit
[01:31:38] [Worker-Main-2/INFO]: Loaded 7 recipes
[01:31:43] [Server thread/INFO]: Starting minecraft server version 1.16.3
[01:31:43] [Server thread/INFO]: Loading properties
[01:31:44] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-2740d5a-890130b (MC: 1.16.3) (Implementing API version 1.16.3-R0.1-SNAPSHOT)
[01:31:44] [Server thread/INFO]: Server Ping Player Sample Count: 12
[01:31:44] [Server thread/INFO]: Using 4 threads for Netty based IO
[01:31:44] [Server thread/INFO]: Debug logging is disabled
[01:31:44] [Server thread/INFO]: Default game type: SURVIVAL
############################################################
# +------------------------------------------------------+ #
# | Notes | #
# +------------------------------------------------------+ #
############################################################
# This is the config file for EssentialsX.
# This config was generated for version 2.18.1.0.
# If you want to use special characters in this document, such as accented letters, you MUST save the file as UTF-8, not ANSI.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"workbench.colorTheme": "doom-one",
"terminal.integrated.inheritEnv": false,
"editor.fontFamily": "'Fira Code', Menlo, Monaco, 'Courier New', monospace",
"editor.fontWeight": 500,
"debug.console.fontSize": 14,
"terminal.integrated.fontSize": 14,
"scm.inputFontSize": 14,
"editor.minimap.enabled": false,
"atomKeymap.promptV3Features": true,