This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# imports aliases from .bash_aliases to config.fish as abbreviations | |
# | |
FISHCFG=~/.config/fish/config.fish | |
BASH_ALIASES=~/.bash_aliases | |
echo "" >> $FISHCFG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set autoindent | |
set guidestripe 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# for fish shell: | |
# .. put it into ~/.config/fish/config.fish | |
# .. tested with fish 3.7.1 | |
# | |
# cd's into a directory and creates it if it doesn't | |
# exist yet | |
# | |
# USAGE: cdd DIR | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ask if something is ok, exit if it's not | |
# if OPTION_Y variable is "-y", do nothing | |
prompt_confirm () { | |
if [ "$OPTION_Y" != "-y" ]; then | |
printf "%s (y/n) " "$*" | |
read -r PROCEED | |
if [ "$PROCEED" != "y" ]; then | |
echo "abort" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ALIASES_URL=https://gist.githubusercontent.com/okurka12/cc3769db8e6f57dfdf091428095b7e00/raw | |
ALIASES_BACKUP=.bash_aliases.old | |
ALIASES_NEW=.bash_aliases.new | |
# ask if something is ok, exit if it's not | |
# if OPTION_Y variable is "-y", do nothing | |
prompt_confirm () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# a bash function to mkdir and cd | |
# add to the end of .bashrc | |
# | |
# author: vit pavlik | |
# | |
# command to change directory to a directory that doesnt exist yet | |
cdd () { | |
if [ ! -d "$1" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Prints stdin input without diacritics. | |
# Expects a text in czech language. | |
# | |
# Author: okurka12 | |
# | |
# Date: 2024-07-21 | |
# | |
# reads from stdin and outputs on stdout | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
rem | |
rem Usage: .\snap.bat | |
rem | |
rem Upon invocation, copies `name.ext` to `name_1.ext`. | |
rem If `name_1.ext` already exists, copies to `name_2.ext`, | |
rem then `name_3.ext` and so on... | |
rem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# part of the knuth-morris-pratt algorithm: | |
# generation of the prefix table/fail vector | |
# | |
# víteček 🔥💯 (okurka12), January 2024 | |
# | |
def ppre(s: str) -> set[str]: | |
"""returns a set of all proper prefixes of `s`""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# My favorite aliases for bash | |
# | |
# for vanilla debian installations (where there's no poweroff cmd) | |
alias shutdown='sudo systemctl poweroff' | |
alias poweroff='sudo systemctl poweroff' | |
# those can be uncommented directly in .bashrc but why not have it here | |
alias grep='grep --color=auto' |