Skip to content

Instantly share code, notes, and snippets.

View pawelrubin's full-sized avatar
🐍

Paweł Rubin pawelrubin

🐍
View GitHub Profile
void kill() {
alive = false;
}
@pawelrubin
pawelrubin / set_git_graph.sh
Last active November 28, 2019 11:53
git alias for `git graph` command.
git config --global alias.graph "log --branches --remotes --tags --graph --pretty=format:'%C(#f2fc3f)(%cr)%C(#66f0f9) %an %C(#cd9a00)%h%C(#70f963)%d %Creset%s'"
@pawelrubin
pawelrubin / fake_commit.sh
Last active January 10, 2020 01:05
shell function for making commits with faked date. Just add it to your `~/.bashrc`.
function fake_commit {
local date=$1
local message=$2
export GIT_{AUTHOR,COMMITTER}_DATE="$(LC_TIME=en_US date -d "$date")"
git commit -m "$message"
unset GIT_{AUTHOR,COMMITTER}_DATE
}
@pawelrubin
pawelrubin / getFunctionName.jl
Created January 5, 2020 23:10
Top notch utility to get function names in Julia language.
function getFunctionName(fun) :: String
split(string(fun), '.')[end]
end
@pawelrubin
pawelrubin / git fap
Last active April 19, 2020 18:51
Introducing git fap - amend last commit and push, with force
[alias] fap = !git commit --amend --no-edit && git push --force-with-lease
[tool.poetry]
name = "source"
[tool.poetry.dependencies]
python = "~3.8"
dohq-artifactory = {git = "https://github.com/devopshq/artifactory.git", rev = "support-python-38-glob"}
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
@pawelrubin
pawelrubin / resize_swap.sh
Created October 24, 2020 13:15
Resize swap memory, Ubuntu
sudo swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=1G count=8
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# add the new swapfile if it isn’t already there
echo "/swapfile none swap sw 0 0" >> /etc/fstab
[tool.poetry]
name = "test_poetry"
version = "0.1.0"
description = ""
authors = ["Paweł Rubin <prubin@vewd.com>"]
[tool.poetry.dependencies]
python = "^3.9"
[tool.poetry.dev-dependencies]
[tool.poetry]
name = "test_poetry"
version = "0.1.0"
description = ""
authors = ["Paweł Rubin <prubin@vewd.com>"]
[tool.poetry.dependencies]
python = "^3.9"
example-pkg = { path = "./example_pkg", develop = true, extras = ["foo"] }
[[package]]
name = "certifi"
version = "2020.12.5"
description = "Python package for providing Mozilla's CA Bundle."
category = "main"
optional = false
python-versions = "*"
[[package]]
name = "chardet"