Skip to content

Instantly share code, notes, and snippets.

View markatom's full-sized avatar

Tomáš Markacz markatom

View GitHub Profile
@markatom
markatom / git-auto-fixup.sh
Created March 10, 2023 16:16
Git Auto Fixup script
#!/bin/bash
BASE_COMMIT=$1
if [[ -z $BASE_COMMIT ]]; then
BASE_COMMIT=$(git rev-list --simplify-by-decoration --max-count 1 --skip 1 HEAD)
fi
git reset
MODIFIED_FILES=$(git status --porcelain | cut -c 4-)
for MODIFIED_FILE in $MODIFIED_FILES; do
FILE_COMMITS=$(git --no-pager log --format='%H' $BASE_COMMIT..HEAD -- $MODIFIED_FILE)
if [[ $(echo "$FILE_COMMITS" | wc -l) -gt 1 ]]; then
@markatom
markatom / .gitconfig
Last active August 23, 2019 08:30
Base git config suitable for beginners
[user]
name = John Doe
email = john.doe@example.com
[core]
editor = nano # use what you like
[status]
showUntrackedFiles = all # show also individual files in untracked directories
[push]
@markatom
markatom / cycle-metasyntactic-variables.vim
Created August 24, 2018 11:16 — forked from hail2u/cycle-metasyntactic-variables.vim
'foo', 'bar', 'baz', 'qux', 'quux', 'corge', 'grault', 'garply', 'waldo', 'fred', 'plugh', 'xyzzy', 'thud'の上で<C-a>/<C-x>すると順にサイクルしてくれるやつ。レジスター使ってる。
" Cycle metasyntactic variables
function! s:CycleMetasyntacticVariables(num)
if type(a:num) != type(0)
return
endif
let vars = ['foo', 'bar', 'baz', 'qux', 'quux', 'corge', 'grault', 'garply', 'waldo', 'fred', 'plugh', 'xyzzy', 'thud']
let cvar = expand('<cword>')
let i = index(vars, cvar)
@markatom
markatom / .gitconfig
Last active October 3, 2022 09:08
Personal .gitconfig
[core]
excludesfile = ~/.gitignore
editor = nvim
pager = BAT_PAGER='less -iRx4' delta -n --theme='darcula' --highlight-removed --hunk-style plain
[user]
name = Tomáš Markacz
email = tomas.markacz@gmail.com
[remote]
[core]
excludesfile = ~/.gitignore
editor = nano
[user]
name = Tomáš Markacz
email = tomas.markacz@gmail.com
[pretty]
custom = %Cblue%h %Cgreen%an %C(yellow)%ar%Cred%d%n%Creset%s
local user='%{$fg_bold[green]%}%n@%m%{$reset_color%}'
local pwd='%{$fg_bold[blue]%}%~%{$reset_color%}'
local return_code='%(?..%{$fg[red]%}%?↵%{$reset_color%})'
local git_branch='$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
local privileges='%(!.#.$)'
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[blue]%}*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[red]%}!%{$reset_color%}"
if [[ -r /usr/local/lib/python2.7/dist-packages/powerline/bindings/zsh/powerline.zsh ]]; then
source /usr/local/lib/python2.7/dist-packages/powerline/bindings/zsh/powerline.zsh
fi
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each

Keybase proof

I hereby claim:

  • I am markatom on github.
  • I am markatom (https://keybase.io/markatom) on keybase.
  • I have a public key whose fingerprint is 59E8 0E0D 5AB3 7C71 9D2E 54FE 1643 A9AE 824D 5558

To claim this, I am signing this object:

@markatom
markatom / createvh
Created March 3, 2015 13:23
Create virtual host
#!/bin/bash
if [ -z $1 ]; then
echo Usage: $0 project-name >&2
exit 1
fi
CONFIG=$(cat << 'END'
<VirtualHost *:80>
ServerName %name%.dev
@markatom
markatom / markatom.zsh-theme
Last active August 29, 2015 14:13
My zsh theme
local user='%{$fg_bold[green]%}%n@%m%{$reset_color%}'
local pwd='%{$fg_bold[blue]%}%~%{$reset_color%}'
local return_code='%(?..%{$fg[red]%}%?↵%{$reset_color%})'
local git_branch='$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
local privileges='%(!.#.$)'
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[blue]%}*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[red]%}!%{$reset_color%}"