Skip to content

Instantly share code, notes, and snippets.

View ivkremer's full-sized avatar
🏦
Checkout Functionality Master

Ilya Kremer ivkremer

🏦
Checkout Functionality Master
View GitHub Profile
@ivkremer
ivkremer / git-bc.sh
Last active November 3, 2023 17:02
Current Git branch copy function for Bash
# Echo only current branch name and copy it to clipboard.
function git-bc {
local copier=""
if which pbcopy > /dev/null; then
copier=(pbcopy)
elif which xsel > /dev/null; then
copier=(xsel -ib)
elif which xclip > /dev/null; then
copier=(xclip -sel clip)
fi
@ivkremer
ivkremer / starship.toml
Last active March 31, 2025 21:59
Starship config (see https://starship.rs/config)
format = """
$time\
$username\
$hostname\
$localip\
$shlvl\
$singularity\
$kubernetes\
$directory\
$vcsh\
@ivkremer
ivkremer / aliases.sh
Last active March 31, 2025 21:27
Useful aliases for Bash
alias l="ls -AlGht"
alias dirsize="du -hs"
@ivkremer
ivkremer / git-push.sh
Last active May 9, 2023 14:04
Smart git push function for Bash
#!/bin/bash
# Push to the repo (same upstream by default).
# SYNOPSIS
# git-push [<msg>] [<pathspec>...] [<options>...]
# EXAMPLES
# git-push --no-verify
function git-push {
local printer=(echo)
if which cowsay > /dev/null; then
@ivkremer
ivkremer / git-ci.sh
Last active January 4, 2025 16:53
Smart git commit function for Bash
#!/bin/bash
# Commit to the git repo adding the ticket number to the beginning of the message.
# SYNOPSIS
# git-ci [<msg>] [<pathspec>...] [<options>...]
# EXAMPLES
# git-ci 'Improve styles' web/static/main.css --no-verify
function git-ci {
local printer=(echo)
if which cowsay > /dev/null; then
@ivkremer
ivkremer / l.fish
Last active February 8, 2020 22:24
Fish Shell – Smart alias for `ls`
# Smart alias for ls command.
# Usage:
# l [other ls options] [path]
function l
ls -Alh $argv[1]
end
# Paste this code to your terminal and put `funcsave l`.
# Default functions directory is `~/.config/fish/functions/`.
@ivkremer
ivkremer / git-push.fish
Last active January 28, 2020 14:07
Fish Shell – Function for pushing
# Pushes in a git repo.
# Usage:
# git-push
function git-push
git rev-parse > /dev/null 2>/dev/null
if test "$status" != "0"
echo "Not a git repo, aborting."
return
end
@ivkremer
ivkremer / git-tag.fish
Created January 28, 2020 14:03
Fish Shell – Function for displaying tags
# Shows tags ordered descendingly.
# Usage:
# git-tag
function git-tag
git tag -l --sort=-v:refname | less
end
# Paste this code to your terminal and put `funcsave git-tag`.
# Default functions directory is `~/.config/fish/functions/`.
@ivkremer
ivkremer / git-ci.fish
Created January 28, 2020 14:03
Fish Shell – Smart `git commit` function
# Commits files in a git repo.
# Usage:
# git-ci 'Change button color'
# git-ci merge
# 'git-ci merge' will do a merge with a default merge message and --no-verify option
# git-ci 'Change button color' --param1 --param2 file1.txt file2.txt --param3 ...
function git-ci
git rev-parse > /dev/null 2>/dev/null
if test "$status" != "0"