Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
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
import sys,os | |
import curses | |
def draw_menu(stdscr): | |
k = 0 | |
cursor_x = 0 | |
cursor_y = 0 | |
# Clear and refresh the screen for a blank canvas | |
stdscr.clear() |
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
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
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
"""Find import and import from statements | |
""" | |
import ast | |
from pathlib import Path | |
class ImportRecord: | |
@classmethod | |
def toplevel_imports(cls, root: Path, prune: list[str] = None) -> list[str]: |
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
**VS CODE Productivity Shortcuts** 👩💻🧑🏽💻👨🏼💻👩🏼💻👩🏾💻 | |
A kind note: I haven't tested these on windows, if you notice an error, drop it in the comments :). | |
1. Opening and closing sidebar 📂 | |
The sidebar can be opened and closed without clicking on the left-hand side tab using the following shortcuts. | |
Mac — Command + B | |
Windows — Ctrl + B | |
—— |
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
# This shell function streamlines the process of visiting repository URLs for faster navigation. | |
# With a simple command, "openrepo", you can easily visit the repository URL associated with the current folder you're in. | |
# This is particularly useful when you need to quickly access the repository of the project you're working on, without | |
# having to navigate to the URL manually. By executing the "openrepo" command from the command line, the script will | |
# automatically open the associated repository URL in your default browser. This saves time and eliminates the need for | |
# manual navigation, making it an ideal solution for developers and anyone else who regularly interacts with repositories. | |
openrepo() { | |
regex='^(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]\.[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]$' | |
remote_url=$(git remote get-url origin) |
- Assuming you have multiple Heroku apps and Git remote like so:
development https://git.heroku.com/xxx.git (fetch)
development https://git.heroku.com/xxx.git (push)
origin git@bitbucket.org:xxx/xxx.git (fetch)
origin git@bitbucket.org:xxx/xxx.git (push)
production https://git.heroku.com/xxx.git (fetch)
production https://git.heroku.com/xxx.git (push)
staging https://git.heroku.com/xxx.git (fetch)
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
""" | |
Script to print all Unicode flag emoji are also a valid flag when reversed. | |
Output of this script: | |
🇦🇬 (Antigua and Barbuda) reverses to 🇬🇦 (Gabon) | |
🇦🇱 (Albania) reverses to 🇱🇦 (Lao People's Democratic Republic) | |
🇦🇲 (Armenia) reverses to 🇲🇦 (Morocco) | |
🇦🇶 (Antarctica) reverses to 🇶🇦 (Qatar) | |
🇦🇸 (American Samoa) reverses to 🇸🇦 (Saudi Arabia) |
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
""" | |
Script to post a code snippet to PyBites CodeImag.es | |
If you see other use cases (e.g. process a csv file with snippets), | |
contact @bbelderbos on Twitter, thanks. | |
""" | |
from pprint import pprint as pp | |
# pip install requests python-decouple | |
import requests | |
from decouple import config |
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
""" | |
The wins file generator script we use at PyBites | |
Because it matters! | |
https://pybit.es/articles/boost-your-motivation-with-brag-doc/ | |
""" | |
from datetime import date, datetime | |
import sys | |
LAST_WEEK_NUMBER = 52 |
NewerOlder