Skip to content

Instantly share code, notes, and snippets.

@abalaci
abalaci / winterm-git-bash-profile.jsonc
Last active March 27, 2022 18:57
A minimalistic Git Bash profile for Windows Terminal.
/* NOTE:
In order for Git Bash to save its command history when used via Windows Terminal,
the following line should be added to the ~/.bash_profile file:
PROMPT_COMMAND='history -a'
*/
{
"guid": "{a775046d-402f-4b65-9a29-abefaafcb815}",
"name": "Git Bash",
"commandline" : "\"%PROGRAMFILES%\\Git\\usr\\bin\\bash.exe\" -i -l",
@abalaci
abalaci / vscode-settings.json
Last active August 16, 2021 10:31
A collection of common Visual Studio Code preferences.
{
"diffEditor.ignoreTrimWhitespace": false,
"editor.fontFamily": "'Fira Code', monospace",
"editor.fontLigatures": false,
"editor.renderControlCharacters": true,
"editor.renderWhitespace": "all",
"editor.wordWrap": "on",
"files.trimTrailingWhitespace": true,
"telemetry.enableTelemetry": false
}
@abalaci
abalaci / .editorconfig
Last active March 28, 2021 18:17
A collection of common .editorconfig preferences.
# https://editorconfig-specification.readthedocs.io/
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
tab_width = 4
@abalaci
abalaci / cheat.sh
Last active April 4, 2024 12:21
A Bash cheat sheet for various tasks on Ubuntu-based distros.
# Add a string to the beginning of each line in a file:
awk '{ print "prefix" $0 }' PATH-TO-FILE
# Append a directory to the PATH environment variable:
PATH="${PATH:+${PATH}:}/path/to/directory"
# Change author for last N Git commits:
git rebase -i HEAD~N -x "git commit --amend --author 'Author Name <author.name@mail.com>' --no-edit"
# Change the password of a Linux user account:
@abalaci
abalaci / spget.sh
Created May 4, 2020 19:21
A Bash script to download free e-books from Springer.
#! /bin/bash
mkdir springer-open
cd springer-open
wget -O "search-results.csv" "https://link.springer.com/search/csv?facet-language=%22En%22&facet-content-type=%22Book%22&package=openaccess"
gawk -vFPAT='[^,]*|"[^"]*"' 'NR>1 { gsub(/"/, "", $6); print "https://link.springer.com/content/epub/" $6 ".epub" }' "search-results.csv" > "items.csv"
wget -w 3 -t 0 --content-disposition -i items.csv
# https://github.com/github/gitignore
# .NET build output
bin/
obj/
# NuGet packages folder
packages/
# Visual Studio cache/options directory