Skip to content

Instantly share code, notes, and snippets.

View tomaszputon's full-sized avatar

Tomasz Puton tomaszputon

  • Bydgoszcz / Kraków, PL
View GitHub Profile
@ourway
ourway / best_of_best.py
Last active July 6, 2022 05:00
Best Python Snippets
## 1::calculating_with_dictionaries
# example.py
#
# Example of calculating with dictionaries
prices = {"ACME": 45.23, "AAPL": 612.78, "IBM": 205.55, "HPQ": 37.20, "FB": 10.75}
# Find min and max price
min_price = min(zip(prices.values(), prices.keys()))
max_price = max(zip(prices.values(), prices.keys()))
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 30, 2024 23:36
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName