From 14236c43cbbfcc7efeed44bf8a37dbfc66b445a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Rom=C3=A1n?= Date: Fri, 24 Sep 2021 14:13:41 -0700 Subject: [PATCH] style: fix all supported markdownlint violations --- _posts/2020-08-30-init.md | 2 +- _posts/2020-08-31-welcome.md | 54 ++++++++++++------- ...09-04-jekyll-compose-a-must-have-plugin.md | 4 +- _posts/2020-09-14-my-journey-into-python.md | 2 +- ...creating-a-bootable-installer-for-macos.md | 6 ++- .../2020-09-21-working-with-pyenv-on-macos.md | 38 ++++++++----- ...020-10-01-configuring-jython-in-pycharm.md | 38 +++++++++---- ...organization-s-domain-on-google-domains.md | 2 +- ...020-11-02-switching-from-master-to-main.md | 2 +- .../2020-11-17-let-s-talk-about-ignition.md | 2 +- ...020-12-09-release-ignition-8-1-1-jython.md | 11 ++-- _posts/2020-12-09-release-ignition-8-1-1.md | 11 ++-- ...dio-homebrew-and-contributing-on-github.md | 26 ++++----- _posts/2020-12-22-79-characters.md | 26 ++++++--- ...bleshooting-gpg-signed-commits-on-macos.md | 12 +++-- ...flake8-and-isort-to-format-python2-code.md | 37 +++++++------ _posts/2021-04-02-ignition-8-1-4-release.md | 4 +- _posts/2021-04-29-ignition-8-1-5-release.md | 4 +- ...-updating-pip-and-all-outdated-packages.md | 15 ++++-- ...ommit-ci-and-pydocstyle-join-the-family.md | 2 +- _posts/2021-06-26-of-camels-and-snakes.md | 5 +- ...nstalled-via-homebrew-to-pyenv-versions.md | 16 +++--- 22 files changed, 195 insertions(+), 124 deletions(-) diff --git a/_posts/2020-08-30-init.md b/_posts/2020-08-30-init.md index b6180c0..f6694f5 100644 --- a/_posts/2020-08-30-init.md +++ b/_posts/2020-08-30-init.md @@ -7,4 +7,4 @@ tags: [general] ```python print("Hello World!") -``` \ No newline at end of file +``` diff --git a/_posts/2020-08-31-welcome.md b/_posts/2020-08-31-welcome.md index d2f88f6..a185dd2 100644 --- a/_posts/2020-08-31-welcome.md +++ b/_posts/2020-08-31-welcome.md @@ -12,6 +12,7 @@ I learned about [GitHub Pages](https://pages.github.com/){:target="_blank"} back So here is a guide on how I got myself started using GitHub pages. ### Table of Contents + 1. [Assumptions](#assumptions) 1. [Getting started with GitHub pages](#getting-started-with-github-pages) 1. [Getting rbenv set up on macOS](#getting-rbenv-set-up-on-macos) @@ -42,34 +43,45 @@ Just follow these steps: 1. Install Command Line Tools for Xcode ([link](https://developer.apple.com/download/more/?=xcode){:target="_blank"}) 1. Install Homebrew + ```bash - $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" ``` 1. Install rbenv + ```bash - $ brew install rbenv + brew install rbenv ``` + 1. Set up rbenv integration with your shell + ```bash - $ rbenv init + rbenv init ``` + 1. Add it to your bash profile + ```bash - $ echo 'eval "$(rbenv init -)"' >> ~/.zshrc + echo 'eval "$(rbenv init -)"' >> ~/.zshrc ``` + 1. Restart your shell so the path changes take effect + ```bash - $ exec "$SHELL" + exec "$SHELL" ``` + 1. Check your rbenv installation + ```bash - $ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash + curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash ``` ### Installing a ruby version and setting a global version with rbenv 1. List stable versions + ```bash $ rbenv install --list 2.5.8 @@ -81,25 +93,28 @@ Just follow these steps: rbx-5.0 truffleruby-20.2.0 truffleruby+graalvm-20.2.0 - + Only latest stable releases for each Ruby implementation are shown. Use 'rbenv install --list-all' to show all local versions. ``` 1. Install your desired version. + ```bash - $ rbenv install 2.7.2 + rbenv install 2.7.2 ``` 1. Once installed, list all versions + ```bash - $ rbenv versions + rbenv versions ``` 1. Select your desired version + ```bash - $ rbenv global 2.7.2 - $ rbenv rehash + rbenv global 2.7.2 + rbenv rehash ``` And you're all set! @@ -114,14 +129,14 @@ As of this writing, the latest version for Jekyll is 4.1.1, which is not yet su To Install Jekyll we need to run the following commands: ```bash -$ gem install bundler -$ gem install jekyll -v 3.9.0 +gem install bundler +gem install jekyll -v 3.9.0 ``` To verify, run the following commands: ```bash -$ which jekyll +$ which jekyll /Users/thecesrom/.rbenv/shims/jekyll $ bundle exec jekyll --version jekyll 3.9.0 @@ -138,7 +153,7 @@ The instructions are straightforward; found [here](https://github.com/daattali/b Once you get it set up, open a Terminal session in your blog's root directory and run the following command: ```bash -$ bundle install +bundle install ``` This will install all necessary dependencies and get you one step closer. @@ -148,13 +163,14 @@ This will install all necessary dependencies and get you one step closer. I am using [Visual Studio Code](https://code.visualstudio.com/){:target="_blank"} for editing my site, but you may use another text editor or IDE out there. And after some customization I just run: + ```bash -$ bundle exec jekyll serve +bundle exec jekyll serve ``` ![vscode]({{ site.url }}/assets/img/vscode.png) -And my site is now live at http://127.0.0.1:4000/ +And my site is now live at And this is the final product: @@ -170,7 +186,7 @@ Here are a few links and extensions that you might find useful: - [A Guide To Using GitHub Pages](https://www.thinkful.com/learn/a-guide-to-using-github-pages/){:target="_blank"}. *Thinkful Programming Guides* - Visual Studio Code extensions: - - docs-markdown ([link](https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-markdown){:target="_blank"}) - - docs-preview ([link](https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-preview){:target="_blank"}) + - docs-markdown ([link](https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-markdown){:target="_blank"}) + - docs-preview ([link](https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-preview){:target="_blank"}) Thanks for reading! diff --git a/_posts/2020-09-04-jekyll-compose-a-must-have-plugin.md b/_posts/2020-09-04-jekyll-compose-a-must-have-plugin.md index aa44164..fdec9f8 100644 --- a/_posts/2020-09-04-jekyll-compose-a-must-have-plugin.md +++ b/_posts/2020-09-04-jekyll-compose-a-must-have-plugin.md @@ -26,12 +26,12 @@ end After successfully installing it, just by typing the following command I get a new drat under the `_drafts` folder: ```bash -$ bundle exec jekyll draft "New Draft" +bundle exec jekyll draft "New Draft" ``` And `jekyll-compose` takes care of properly naming the file, so you can take care of the important stuff. -### Summary: +### Summary 1. Add `jekyll-compose` to your `Gemfile` 1. Execute `bundle` command diff --git a/_posts/2020-09-14-my-journey-into-python.md b/_posts/2020-09-14-my-journey-into-python.md index 1fbc851..327d79b 100644 --- a/_posts/2020-09-14-my-journey-into-python.md +++ b/_posts/2020-09-14-my-journey-into-python.md @@ -65,4 +65,4 @@ When I started using Python in Ignition, I was only using it for the code behind Now I have created some packages shared across multiple installations and applied [OOP](https://realpython.com/python3-object-oriented-programming/){:target="_blank"} principles by creating supporting classes in my projects. And in the last four years since I started working with Python, I've learned so much and will continue learning. -I am happy to be writing in Python, and I look forward to many more years. \ No newline at end of file +I am happy to be writing in Python, and I look forward to many more years. diff --git a/_posts/2020-09-16-creating-a-bootable-installer-for-macos.md b/_posts/2020-09-16-creating-a-bootable-installer-for-macos.md index 8d60f28..88004cc 100644 --- a/_posts/2020-09-16-creating-a-bootable-installer-for-macos.md +++ b/_posts/2020-09-16-creating-a-bootable-installer-for-macos.md @@ -19,9 +19,11 @@ And these are the instructions: 1. Download [macOS Catalina](https://apps.apple.com/us/app/macos-catalina/id1466841314?mt=12){:target="_blank"} from the Mac App Store 1. Once downloaded run the following command: + ```bash - $ sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/INSTALLER + sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/INSTALLER ``` + 1. Restart your Mac and press the alt-option key as soon as it restarts, so you are prompted to select a Startup Disk 1. Select the **macOS Catalina Installer** 1. Select **Disk Utility** and click **Continue** @@ -41,4 +43,4 @@ And these are the instructions: Once the installation is done, you'll be asked to configure your Mac. -And that's it! You'll have a "brand new" Mac! \ No newline at end of file +And that's it! You'll have a "brand new" Mac! diff --git a/_posts/2020-09-21-working-with-pyenv-on-macos.md b/_posts/2020-09-21-working-with-pyenv-on-macos.md index 7440444..384dfe1 100644 --- a/_posts/2020-09-21-working-with-pyenv-on-macos.md +++ b/_posts/2020-09-21-working-with-pyenv-on-macos.md @@ -12,26 +12,30 @@ date: 2020-09-21 13:02 -0700 last-updated: 2021-06-07 20:49 -0700 --- ## Table of Contents + - [Introduction](#introduction) - [Pre-requisites](#pre-requisites) - [Why pyenv?](#why-pyenv) - [Installing pyenv](#installing-pyenv) - - [Installing Python 3.9](#installing-python-39) - - [Installing Python 2.7](#installing-python-27) - - [Setting a global version of Python](#setting-a-global-version-of-python) + - [Installing Python 3.9](#installing-python-39) + - [Installing Python 2.7](#installing-python-27) + - [Setting a global version of Python](#setting-a-global-version-of-python) - [Success!](#success) - [Further reading](#further-reading) - [Sources](#sources) ## Introduction + This is not meant to be a detailed guide on the many ways you could install Homebrew, and pyenv, but a look into what I did to get my environment set up for my personal projects. ## Pre-requisites + Xcode Command Line Tools ([link](https://developer.apple.com/download/more/?=xcode){:target="_blank"}) Homebrew + ```bash -$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" ``` Let's begin. @@ -49,26 +53,30 @@ Before [breathing new life into my MacBook Air]({{ page.previous.url | relative_ ## Installing pyenv Install dependencies + ```bash -$ brew install openssl readline sqlite3 xz zlib +brew install openssl readline sqlite3 xz zlib ``` Install pyenv + ```bash -$ brew install pyenv +brew install pyenv ``` Load `pyenv` automatically by running the following command to add it to your shell {: .box-note} Starting with `pyenv` [v2.0.0](https://github.com/pyenv/pyenv/releases/tag/v2.0.0){:target="_blank"} the `pyenv init` command has changed. + ```bash -$ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init --path)"\nfi' >> ~/.zshrc +echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init --path)"\nfi' >> ~/.zshrc ``` Restart shell + ```bash -$ exec "$SHELL" +exec "$SHELL" ``` Next, I'll install specific Python versions. @@ -76,6 +84,7 @@ Next, I'll install specific Python versions. ### Installing Python 3.9 First, let's get a list of all 3.9 versions: + ```bash $ pyenv install --list | grep " 3\.9" 3.9.0 @@ -90,7 +99,7 @@ $ pyenv install --list | grep " 3\.9" Installing the latest 3.9 release. ```bash -$ pyenv install 3.9.5 +pyenv install 3.9.5 ``` ### Installing Python 2.7 @@ -100,7 +109,6 @@ For the [Ignition](https://github.com/thecesrom/Ignition/){:target="_blank"} pro So, first, I will install Python 2.7.18. - ```bash $ pyenv install --list | grep " 2\.7" 2.7.0 @@ -131,7 +139,7 @@ Python 2.7 reached its EOL on January 1, 2020. See: [Sunsetting Python 2](https: Installing the final 2.7 version: ```bash -$ pyenv install 2.7.18 +pyenv install 2.7.18 ``` ### Setting a global version of Python @@ -148,7 +156,7 @@ $ pyenv versions Run `pyenv global ` to set the global version of Python to be used in all shells. ```bash -$ pyenv global 3.9.5 +pyenv global 3.9.5 ``` Verify your selection by running `pyenv versions`. @@ -162,15 +170,17 @@ $ pyenv versions Alternatively, you could [specify multiple versions as global at once](https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-global-advanced){:target="_blank"}. -## Success! +## Success And by doing all of the above I have completed setting up my computer for working on my projects. Happy coding! ## Further reading + 1. pyenv :: Modern Python Developer's Toolkit - [https://pycon.switowski.com/02-packages/pyenv/](https://pycon.switowski.com/02-packages/pyenv/){:target="_blank"} ## Sources + [^1]: pyenv/pyenv: Simple Python version management - [https://github.com/pyenv/pyenv](https://github.com/pyenv/pyenv){:target="_blank"} -[^2]: Managing Multiple Python Versions With pyenv - [https://realpython.com/intro-to-pyenv/](https://realpython.com/intro-to-pyenv/){:target="_blank"} \ No newline at end of file +[^2]: Managing Multiple Python Versions With pyenv - [https://realpython.com/intro-to-pyenv/](https://realpython.com/intro-to-pyenv/){:target="_blank"} diff --git a/_posts/2020-10-01-configuring-jython-in-pycharm.md b/_posts/2020-10-01-configuring-jython-in-pycharm.md index e54af86..844a86b 100644 --- a/_posts/2020-10-01-configuring-jython-in-pycharm.md +++ b/_posts/2020-10-01-configuring-jython-in-pycharm.md @@ -7,6 +7,7 @@ date: 2020-10-01 19:02 -0700 last-updated: 2021-01-28 15:03 -0800 --- ## Table of Contents + - [What is Jython?](#what-is-jython) - [Why do I use Jython?](#why-do-i-use-jython) - [Jython within Ignition](#jython-within-ignition) @@ -76,25 +77,32 @@ Since I intend to set up Jython as a Project Interpreter in PyCharm, and conside 1. Java 11 1. Via [Homebrew](https://brew.sh/){:target="_blank"}. + ```bash - $ brew install --cask zulu11 + brew install --cask zulu11 ``` + 1. Or from Azul for macOS ([.zip](https://cdn.azul.com/zulu/bin/zulu11.39.15-ca-jdk11.0.7-macosx_x64.zip){:target="_blank"}, [.dmg](https://cdn.azul.com/zulu/bin/zulu11.39.15-ca-jdk11.0.7-macosx_x64.dmg){:target="_blank"}, [.tar.gz](https://cdn.azul.com/zulu/bin/zulu11.39.15-ca-jdk11.0.7-macosx_x64.tar.gz){:target="_blank"}). 1. Jython 2.7.1 1. Via [Homebrew](https://brew.sh/){:target="_blank"}. Just tap [coatl-dev's Homebrew tap](https://github.com/coatl-dev/homebrew-coatl-dev/){:target="_blank"}, and install `jython@2.7.1`: + ```bash - $ brew install coatl-dev/coatl-dev/jython@2.7.1 + brew install coatl-dev/coatl-dev/jython@2.7.1 ``` + Or + ```bash - $ brew tap coatl-dev/coatl-dev - $ brew install jython@2.7.1 + brew tap coatl-dev/coatl-dev + brew install jython@2.7.1 ``` + 1. Or by downloading the installer [Jython Installer v2.7.1](https://search.maven.org/artifact/org.python/jython-installer/2.7.1/jar){:target="_blank"} I decided to install both using `brew`. First `zulu11`: + ```bash $ brew install --cask zulu11 ==> Downloading https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-macosx_x64.dmg @@ -110,6 +118,7 @@ installer: The upgrade was successful. ``` Then `jython@2.7.1`: + ```bash $ brew install coatl-dev/coatl-dev/jython@2.7.1 ==> Installing jython@2.7.1 from coatl-dev/coatl-dev @@ -129,18 +138,18 @@ Illegal reflective access by org.python.core.PySystemState (file:/usr/local/Cell WARNING: Please consider reporting this to the maintainers of org.python.core.PySystemState WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release -Jython 2.7.1 (default:0df7adb1b397, Jun 30 2017, 19:02:43) +Jython 2.7.1 (default:0df7adb1b397, Jun 30 2017, 19:02:43) [OpenJDK 64-Bit Server VM (Azul Systems, Inc.)] on java11.0.7 ``` To circumvent this, you must run Jython with the following flags: ```bash -$ jython -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang=ALL-UNNAMED -J--add-opens=java.base/java.nio=ALL-UNNAMED -J--add-opens=java.base/sun.nio.ch=ALL-UNNAMED -J--add-opens=java.desktop/sun.awt=ALL-UNNAMED -J--add-opens=java.desktop/sun.lwawt.macosx=ALL-UNNAMED -Jython 2.7.1 (default:0df7adb1b397, Jun 30 2017, 19:02:43) +$ jython -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang=ALL-UNNAMED -J--add-opens=java.base/java.nio=ALL-UNNAMED -J--add-opens=java.base/sun.nio.ch=ALL-UNNAMED -J--add-opens=java.desktop/sun.awt=ALL-UNNAMED -J--add-opens=java.desktop/sun.lwawt.macosx=ALL-UNNAMED +Jython 2.7.1 (default:0df7adb1b397, Jun 30 2017, 19:02:43) [OpenJDK 64-Bit Server VM (Azul Systems, Inc.)] on java11.0.7 Type "help", "copyright", "credits" or "license" for more information. ->>> +>>> ``` ### Configuring Jython in PyCharm @@ -153,8 +162,14 @@ Type "help", "copyright", "credits" or "license" for more information. 1. Select **/usr/local/bin/jython** from the **Interpreter** list, and click **OK** 1. PyCharm will name it **Jython 2.7** by default, but you can change it 1. Finally go to **Preferences > Build, Execution, Deployment > Console > Python Console** and add the following flags as **Interpreter options** - ``` - -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang=ALL-UNNAMED -J--add-opens=java.base/java.nio=ALL-UNNAMED -J--add-opens=java.base/sun.nio.ch=ALL-UNNAMED -J--add-opens=java.desktop/sun.awt=ALL-UNNAMED -J--add-opens=java.desktop/sun.lwawt.macosx=ALL-UNNAMED + + ```properties + -J--add-opens=java.base/java.io=ALL-UNNAMED + -J--add-opens=java.base/java.lang=ALL-UNNAMED + -J--add-opens=java.base/java.nio=ALL-UNNAMED + -J--add-opens=java.base/sun.nio.ch=ALL-UNNAMED + -J--add-opens=java.desktop/sun.awt=ALL-UNNAMED + -J--add-opens=java.desktop/sun.lwawt.macosx=ALL-UNNAMED ``` To test it I will be using the [jython](https://github.com/thecesrom/Ignition/tree/jython){:target="_blank"} branch of my [Ignition](https://github.com/thecesrom/Ignition){:target="_blank"} project. @@ -186,5 +201,6 @@ And with that, my friends, you are all set. Thanks, for reading. ### Sources + [^1]: Jython - [link](https://www.jython.org/){:target="_blank"} -[^2]: Ignition User Manual 8.0 - [link](https://docs.inductiveautomation.com/display/DOC80/Scripting#Scripting-WhereIsScriptingUsed?){:target="_blank"} \ No newline at end of file +[^2]: Ignition User Manual 8.0 - [link](https://docs.inductiveautomation.com/display/DOC80/Scripting#Scripting-WhereIsScriptingUsed?){:target="_blank"} diff --git a/_posts/2020-10-14-how-to-verify-your-github-organization-s-domain-on-google-domains.md b/_posts/2020-10-14-how-to-verify-your-github-organization-s-domain-on-google-domains.md index 3be2e09..36ed79d 100644 --- a/_posts/2020-10-14-how-to-verify-your-github-organization-s-domain-on-google-domains.md +++ b/_posts/2020-10-14-how-to-verify-your-github-organization-s-domain-on-google-domains.md @@ -31,4 +31,4 @@ So here are the steps I followed for Google Domains: 1. On the **Data** field paste the code from GitHub, and click on **Add**. The following notification will appear: "Changes to example.com saved. They'll take effect within the next 48 hours." 1. Go back to the verification process on GitHub, and click on **Verify domain**, which will tell you that the verification process might take up to 72 hours -And as easy as that, you're done. \ No newline at end of file +And as easy as that, you're done. diff --git a/_posts/2020-11-02-switching-from-master-to-main.md b/_posts/2020-11-02-switching-from-master-to-main.md index a532658..640154f 100644 --- a/_posts/2020-11-02-switching-from-master-to-main.md +++ b/_posts/2020-11-02-switching-from-master-to-main.md @@ -22,4 +22,4 @@ ___ Are you interested in renaming your `master` branch? -See [here](https://www.w3docs.com/snippets/git/how-to-rename-git-local-and-remote-branches.html){:target="_blank"}, [here](https://www.hanselman.com/blog/easily-rename-your-git-default-branch-from-master-to-main){:target="_blank"}, or [here](https://www.atlassian.com/git/tutorials/using-branches){:target="_blank"}. \ No newline at end of file +See [here](https://www.w3docs.com/snippets/git/how-to-rename-git-local-and-remote-branches.html){:target="_blank"}, [here](https://www.hanselman.com/blog/easily-rename-your-git-default-branch-from-master-to-main){:target="_blank"}, or [here](https://www.atlassian.com/git/tutorials/using-branches){:target="_blank"}. diff --git a/_posts/2020-11-17-let-s-talk-about-ignition.md b/_posts/2020-11-17-let-s-talk-about-ignition.md index a27c881..d8d2fad 100644 --- a/_posts/2020-11-17-let-s-talk-about-ignition.md +++ b/_posts/2020-11-17-let-s-talk-about-ignition.md @@ -26,4 +26,4 @@ And for previous versions, I release the source code for each Ignition release [ Working on this project I have learned some `git`, as well as how to maintain a project that some people may find useful, and finally, it has made me more appreciative of all those maintainers, sometimes unpaid. So please consider supporting them in any way you can. -Happy coding! \ No newline at end of file +Happy coding! diff --git a/_posts/2020-12-09-release-ignition-8-1-1-jython.md b/_posts/2020-12-09-release-ignition-8-1-1-jython.md index 4d324fd..efdeb82 100644 --- a/_posts/2020-12-09-release-ignition-8-1-1-jython.md +++ b/_posts/2020-12-09-release-ignition-8-1-1-jython.md @@ -9,7 +9,6 @@ date: 2020-12-09 19:22 -0800 --- ## [8.1.1-jython](https://github.com/thecesrom/Ignition/releases/tag/v8.1.1-jython){:target="_blank"} - Repository: [thecesrom/Ignition](https://github.com/thecesrom/Ignition){:target="_blank"} · Tag: [v8.1.1-jython](https://github.com/thecesrom/Ignition/releases/tag/v8.1.1-jython){:target="_blank"} · Commit: [2632b83](https://github.com/thecesrom/Ignition/commit/2632b83f78af7b69dd867371607f34d61e23accb){:target="_blank"} · Released by: [thecesrom](https://github.com/thecesrom){:target="_blank"} ### Added @@ -20,9 +19,9 @@ Repository: [thecesrom/Ignition](https://github.com/thecesrom/Ignition){:target= This release has 4 assets: -- Ignition-8.1.1-jython.tar.gz -- Ignition-8.1.1-jython.zip -- Source code (zip) -- Source code (tar.gz) +* Ignition-8.1.1-jython.tar.gz +* Ignition-8.1.1-jython.zip +* Source code (zip) +* Source code (tar.gz) -Visit the [release page](https://github.com/thecesrom/Ignition/releases/tag/v8.1.1-jython){:target="_blank"} to download them. \ No newline at end of file +Visit the [release page](https://github.com/thecesrom/Ignition/releases/tag/v8.1.1-jython){:target="_blank"} to download them. diff --git a/_posts/2020-12-09-release-ignition-8-1-1.md b/_posts/2020-12-09-release-ignition-8-1-1.md index e34fc16..8a00391 100644 --- a/_posts/2020-12-09-release-ignition-8-1-1.md +++ b/_posts/2020-12-09-release-ignition-8-1-1.md @@ -9,7 +9,6 @@ date: 2020-12-09 19:26 -0800 --- ## [8.1.1](https://github.com/thecesrom/Ignition/releases/tag/v8.1.1){:target="_blank"} - Repository: [thecesrom/Ignition](https://github.com/thecesrom/Ignition){:target="_blank"} · Tag: [v8.1.1](https://github.com/thecesrom/Ignition/releases/tag/v8.1.1){:target="_blank"} · Commit: [b4c6cb7](https://github.com/thecesrom/Ignition/commit/b4c6cb72f688754d712fbb5955bcacd3c02a4a86){:target="_blank"} · Released by: [thecesrom](https://github.com/thecesrom){:target="_blank"} ### Added @@ -20,9 +19,9 @@ Repository: [thecesrom/Ignition](https://github.com/thecesrom/Ignition){:target= This release has 4 assets: -- Ignition-8.1.1.tar.gz -- Ignition-8.1.1.zip -- Source code (zip) -- Source code (tar.gz) +* Ignition-8.1.1.tar.gz +* Ignition-8.1.1.zip +* Source code (zip) +* Source code (tar.gz) -Visit the [release page](https://github.com/thecesrom/Ignition/releases/tag/v8.1.1){:target="_blank"} to download them. \ No newline at end of file +Visit the [release page](https://github.com/thecesrom/Ignition/releases/tag/v8.1.1){:target="_blank"} to download them. diff --git a/_posts/2020-12-18-azure-data-studio-homebrew-and-contributing-on-github.md b/_posts/2020-12-18-azure-data-studio-homebrew-and-contributing-on-github.md index 7acb1cc..f5c5053 100644 --- a/_posts/2020-12-18-azure-data-studio-homebrew-and-contributing-on-github.md +++ b/_posts/2020-12-18-azure-data-studio-homebrew-and-contributing-on-github.md @@ -28,23 +28,25 @@ So there were a couple of solutions. And it looks like this. Lines 175-178: + ```json - "AS", - "\t-- body of the stored procedure", - "\tSELECT @param1, @param2", - "GO", + "AS", + "\t-- body of the stored procedure", + "\tSELECT @param1, @param2", + "GO", ``` My solution is to surround those lines with `BEGIN` and `END`, like this: Lines 175-180: + ```json - "AS", - "BEGIN", - "\t-- body of the stored procedure", - "\tSELECT @param1, @param2", - "END", - "GO", + "AS", + "BEGIN", + "\t-- body of the stored procedure", + "\tSELECT @param1, @param2", + "END", + "GO", ``` The problem with this approach is that every time Azure Data Studio gets updated, the `mssql.json` file is replaced and must be re-edited. @@ -64,7 +66,7 @@ And this week I've had my first PR approved for a `cask`. After doing my homewor So, starting now you can run the following command: ```bash -$ brew install azure-data-studio-insiders +brew install azure-data-studio-insiders ``` Azure Data Studio - Insiders will be installed on your machine, and, even better, when you choose the `sqlCreateStoredProc` snippet you'll get the following template: @@ -101,4 +103,4 @@ Will you looke at that? A `BEGIN` and an `END`! And with all this, the moral of the story is: Do your homework, and contribute. -Happy coding! \ No newline at end of file +Happy coding! diff --git a/_posts/2020-12-22-79-characters.md b/_posts/2020-12-22-79-characters.md index 5569aed..a423263 100644 --- a/_posts/2020-12-22-79-characters.md +++ b/_posts/2020-12-22-79-characters.md @@ -14,6 +14,7 @@ When I started using PyCharm for my personal, and work, projects one of the firs I was coming from a C# world where tabs are preferred over spaces, and back in the day there were no style guides for C# code. ### Why style guides are certainly a good thing + I could summarize my comments with just one word: **_consistency_**. Producing consistent code across multiple projects, and applying a style is a positive thing to do. @@ -23,6 +24,7 @@ There are many articles out there about their importance, just search for _codin So I won't repeat what many have said, instead I will share my preferences. ### PEP8 + > PEP stands for Python Enhancement Proposal. A PEP is a design document providing information to the Python community, or describing a new feature for Python or its processes or environment. The PEP should provide a concise technical specification of the feature and a rationale for the feature.[^2] From [PEP 8](https://www.python.org/dev/peps/pep-0008/){:target="_blank"} is where I decided to use 79 characters for code, and 72 characters for the docstring[^3]. @@ -34,6 +36,7 @@ One could trace back the "80 characters/columns per line" constraint to [punched Also, one could argue that with modern screens which come in bigger sizes and offer higher resolution, such a limit is nonsense. Trust me, I use a 55" 4K TV as a computer monitor, but I also use a 13" MacBook Air for working on the same projects, and if I were to *"take full advantage"* of the 3840x2160 resolution from the 4K TV, there would be a lot of horizontal scrolling on my 1440x900 from the MacBook Air; and horizontal scrolling is still undesirable on a PC. ### Docstring formats + Within PyCharm (version 2020.3.1 at the time of this post) a couple of options for docstring formatting are offered. I'll use the following function as an example for each. ```python @@ -45,15 +48,18 @@ def file_exists(filepath): Docstring will autogenerate as soon as you type three double-quotes `"""`, and hit Enter. #### Plain + ```python def file_exists(filepath): """ - + """ import os.path return os.path.isfile(filepath) ``` + #### Epytext + ```python def file_exists(filepath): """ @@ -64,7 +70,9 @@ def file_exists(filepath): import os.path return os.path.isfile(filepath) ``` + #### reStructuredText (PyCharm's default) + ```python def file_exists(filepath): """ @@ -75,11 +83,13 @@ def file_exists(filepath): import os.path return os.path.isfile(filepath) ``` + #### Numpy + ```python def file_exists(filepath): """ - + Parameters ---------- filepath @@ -91,13 +101,15 @@ def file_exists(filepath): import os.path return os.path.isfile(filepath) ``` + #### Google + ```python def file_exists(filepath): """ - + Args: - filepath: + filepath: Returns: @@ -108,8 +120,8 @@ def file_exists(filepath): My preference was the Google format[^4] [^5]. - ### Code formatters + Again, there are many options out there. There's [autopep8](https://github.com/hhatto/autopep8){:target="_blank"}, [Black](https://github.com/psf/black){:target="_blank"}, [YAPF](https://github.com/google/yapf){:target="_blank"}, and, surely, many more. Choosing one would be a matter of preference. Since I still write Python 2.7 code, or rather Jython 2.7.1, at first I chose YAPF because it did what it was supposed to do; format my Python 2 code with a single command. But I've recently switched to Black. And the reason is very simple. Python 2 reached its end-of-life since 2020-01-01, and when you run `pip2` you get the following warning: @@ -136,6 +148,7 @@ All done! ✨ 🍰 ✨ ``` ### Conclusion + A wise man once said: > "It's a matter of preference. But convenience and ease of use override preference." - César Román (2020-12-22). @@ -143,10 +156,11 @@ A wise man once said: Thanks for reading. ### References + [^1]: Stenberg, Daniel (2020-11-30). ["I am an 80 column purist"](https://daniel.haxx.se/blog/2020/11/30/i-am-an-80-column-purist/){:target="_blank"}. [^2]: Warsaw, Barry, et.al. ["What is a PEP?"](https://www.python.org/dev/peps/pep-0001/#what-is-a-pep){:target="_blank"}. PEP 1 -- PEP Purpose and Guidelines. [^3]: van Rossuum, Guido, et.al. (2001-07-05) ["Maximum Line Length"](https://www.python.org/dev/peps/pep-0008/#maximum-line-length){:target="_blank"}. PEP 8 -- Style Guide for Python Code. [^4]: ["Example Google Style Python Dosctrings"](https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html){:target="_blank"}. Sphinx 4.0.0+ documentation. [^5]: ["Google Python Style Guide"](https://google.github.io/styleguide/pyguide.html){:target="_blank"}. Style guides for Google-originated open-source projects. [^6]: ["Python versions"](https://github.com/google/yapf#python-versions){:target="_blank"}. google/yapf: A formatter for Python files. -[^7]: ["Installation and usage"](https://github.com/psf/black#installation-and-usage){:target="_blank"}. psf/black: The uncompromising Python code formatter. \ No newline at end of file +[^7]: ["Installation and usage"](https://github.com/psf/black#installation-and-usage){:target="_blank"}. psf/black: The uncompromising Python code formatter. diff --git a/_posts/2021-01-27-troubleshooting-gpg-signed-commits-on-macos.md b/_posts/2021-01-27-troubleshooting-gpg-signed-commits-on-macos.md index c02bc86..365df94 100644 --- a/_posts/2021-01-27-troubleshooting-gpg-signed-commits-on-macos.md +++ b/_posts/2021-01-27-troubleshooting-gpg-signed-commits-on-macos.md @@ -18,6 +18,7 @@ I have created [an organization](https://github.com/coatl-dev), started [sponsor But yesterday a user's commit `Verified` label caught my attention, so I decided to grab a cup of coffee and learn about [managing commit signature verification](https://docs.github.com/articles/generating-a-gpg-key/), and after following all the necessary steps I was able to generate my GPG key and upload it to GitHub, but there was an issue, which is the main topic of this post. ### The problem + At the [Signing commits](https://docs.github.com/en/github/authenticating-to-github/signing-commits) step I was about to sign my first commit but then tragedy struck. ```bash @@ -47,6 +48,7 @@ What? That doesn't make sense! – I thought to myself. But finally, I saw the light. ### The solution + I found [this great guide](https://eriksamuelsson.com/sign-git-commits-on-github-with-gpg-in-macos/) on how to set up GPG, and some useful [Homebrew](https://brew.sh/) formulae, courtesy of [Erik Samuelsson](https://github.com/samuelsson). But all of the guides that I found did not take into account my current setup; I am using [Powerlevel10k](https://github.com/romkatv/powerlevel10k) by [Roman Perepelitsa](https://github.com/romkatv/), and he had [the answer](https://unix.stackexchange.com/a/608921) to my problem. @@ -68,17 +70,17 @@ $ echo $GPG_TTY And ever since, all my commits are signed by updating my `git` settings: ```bash -$ git config --global user.signiningkey XXXXXXXXXXXXXXXX -$ git config --global commit.gpgsign true +git config --global user.signiningkey XXXXXXXXXXXXXXXX +git config --global commit.gpgsign true ``` And after installing `pinentry-mac`, I don't have to enter my passphrase every single time. ```bash -$ echo 'pinentry-program /usr/local/bin/pinentry-mac' >> ~/.gnupg/gpg-agent.conf -$ killall gpg-agent +echo 'pinentry-program /usr/local/bin/pinentry-mac' >> ~/.gnupg/gpg-agent.conf +killall gpg-agent ``` And done! -Hope this helps. \ No newline at end of file +Hope this helps. diff --git a/_posts/2021-03-06-how-i-use-black-flake8-and-isort-to-format-python2-code.md b/_posts/2021-03-06-how-i-use-black-flake8-and-isort-to-format-python2-code.md index a2a0f37..c5cec66 100644 --- a/_posts/2021-03-06-how-i-use-black-flake8-and-isort-to-format-python2-code.md +++ b/_posts/2021-03-06-how-i-use-black-flake8-and-isort-to-format-python2-code.md @@ -19,6 +19,7 @@ In, what is now, [part 1]({{ site.url }}/2020/12/22/79-characters) I mentioned So let's begin by describing each tool, and how I use them. ### black + > The Uncompromising Code Formatter With `black` you can format Python code from 2.7 all the way to 3.8 (as of version 20.8b1), which makes for a great replacement of [YAPF](https://github.com/google/yapf){:target="_blank"} which can only format code depending on the Python version being used to run it. @@ -26,7 +27,7 @@ With `black` you can format Python code from 2.7 all the way to 3.8 (as of versi My preference is using [PEP 8](https://www.python.org/dev/peps/pep-0008/){:target="_blank"} as my style guide, and so, 79-characters per line of code is what I use. So it's as simple as running the following code at the root of my project and all non-compliant files will be reformatted: ```bash -$ black --line-length 79 --target-version py27 . +black --line-length 79 --target-version py27 . ``` Let's explain each option. @@ -37,27 +38,30 @@ Let's explain each option. Fairly simple. Allow `79` characters per line, and use `py27` as the targetted version. ### isort -> A Python utility / library to sort imports. + +> A Python utility / library to sort imports. And just as their slogan states: "isort your imports, so you don't have to." Command: ```bash -$ isort --multi-line 3 --profile black --python-version 27 . +isort --multi-line 3 --profile black --python-version 27 . ``` The options used are mainly to be compatible with `black` (see [here](https://pycqa.github.io/isort/docs/configuration/black_compatibility/){:target="_blank"}): + - `--multi-line`: Multi line output (0-grid, 1-vertical, 2-hanging, 3-vert-hanging, 4-vert-grid, 5-vert-grid-grouped, 6-vert-grid-grouped-no-comma, 7-noqa, 8-vertical-hanging-indent-bracket, 9-vertical-prefix-from-module-import, 10-hanging-indent-with-parentheses). - - `3-vert-hanging` + - `3-vert-hanging` - `--profile`: Base profile type to use for configuration. Profiles include: black, django, pycharm, google, open_stack, plone, attrs, hug. As well as any shared profiles. - - `black` + - `black` - `--python-version`: Tells isort to set the known standard library based on the specified Python version. Default is to assume any Python 3 version could be the target, and use a union of all stdlib modules across versions. If auto is specified, the version of the interpreter used to run isort (currently: 39) will be used. - - `27` for Python 2.7 + - `27` for Python 2.7 But there's still something missing. `black` does not care about comments or [docstrings](https://www.python.org/dev/peps/pep-0257/){:target="_blank"}, and `isort` cares even less, for obvious reasons; enter `flake8`. ### flake8 + > flake8 is a python tool that glues together pep8, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code. Anthony Sottile ([@asottile](https://gitlab.com/asottile){:target="_blank"}) has mentioned that he plans to drop support for Python 2.7 in future releases, maybe in version [3.9 or 4.0](https://gitlab.com/pycqa/flake8/-/issues/690){:target="_blank"}. @@ -65,7 +69,7 @@ Anthony Sottile ([@asottile](https://gitlab.com/asottile){:target="_blank"}) has Fortunately I can still use it for Python 2 by running the following command: ```bash -$ flake8 --max-doc-length=72 --ignore=E211,E999,F401,F821,W503 +flake8 --max-doc-length=72 --ignore=E211,E999,F401,F821,W503 ``` [PEP 8](https://www.python.org/dev/peps/pep-0008/){:target="_blank"} recommends limiting docstrings or comments to 72 characters, which is exactly what I'm using for flake8. @@ -78,24 +82,25 @@ So let's explain each option used. In my case I am using `72` as the maximum allowed characters for my docstrings, in accordance to PEP 8, and ignoring the following errors: - `E211`: whitespace before ‘(‘ - - Since in Python 2 `print` is not a function, `black` adds a space between the `print` statement from Python 2, and the openning parenthesis + - Since in Python 2 `print` is not a function, `black` adds a space between the `print` statement from Python 2, and the openning parenthesis - `E999`: SyntaxError: invalid syntax - - In my case this occurs again with the `print` statement where I am printing just one arguments like this `print arg` + - In my case this occurs again with the `print` statement where I am printing just one arguments like this `print arg` - `F401`: `module` imported but unused - - I do import some modules in order to get "Intellisense" when I peek into the details in PyCharm + - I do import some modules in order to get "Intellisense" when I peek into the details in PyCharm - `F821`: undefined name `name` - - In one of my libraries I am checking if an argument is a string, and in order to cover my bases with plain strings (`str`) and unicode, I found that using `basestring` would work for all characters, including non-Latin characters + - In one of my libraries I am checking if an argument is a string, and in order to cover my bases with plain strings (`str`) and unicode, I found that using `basestring` would work for all characters, including non-Latin characters - `W503`: line break before binary operator - - It doesn't like when binary operators are broken into multi-line statements + - It doesn't like when binary operators are broken into multi-line statements ### pre-commit + > A framework for managing and maintaining multi-language pre-commit hooks. Finally, let's put it all together with [pre-commit](https://pre-commit.com/){:target="_blank"}. So in order to use `flake8` you'll have to create a `.flake8` file. Mine looks like this: -``` +```properties [flake8] ignore = E211, E999, F401, F821, W503 max-doc-length = 72 @@ -103,7 +108,7 @@ max-doc-length = 72 A `pyproject.toml` file that in my case looks like this: -``` +```properties [tool.black] line-length = 79 target-version = ['py27'] @@ -154,7 +159,7 @@ While you have the option to "`pip`-install" all of these tools, currently I dec But if you do use `pip`, I recommend adding an alias for updating all of your outdated packages that should run the following command: ```bash -$ python -m pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 python -m pip install --upgrade +python -m pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 python -m pip install --upgrade ``` ## Other useful `pip` packages @@ -162,4 +167,4 @@ $ python -m pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 - [`pip-autoremove`](https://pypi.org/project/pip-autoremove/){:target="_blank"} for removing packages and all of their dependencies. - [`pylint`](http://pylint.pycqa.org/en/latest/){:target="_blank"}, a static code analysis tool which looks for programming errors, helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions. -Happy coding! \ No newline at end of file +Happy coding! diff --git a/_posts/2021-04-02-ignition-8-1-4-release.md b/_posts/2021-04-02-ignition-8-1-4-release.md index debd32e..85347b3 100644 --- a/_posts/2021-04-02-ignition-8-1-4-release.md +++ b/_posts/2021-04-02-ignition-8-1-4-release.md @@ -11,7 +11,6 @@ This release is for Ignition [8.1.4](#814httpsgithubcomthecesromignitionreleases ## [8.1.4](https://github.com/thecesrom/Ignition/releases/tag/v8.1.4){:target="_blank"} - Repository: [thecesrom/Ignition](https://github.com/thecesrom/Ignition){:target="_blank"} · Tag: [v8.1.4](https://github.com/thecesrom/Ignition/releases/tag/v8.1.4){:target="_blank"} · Commit: [b4c6cb7](https://github.com/thecesrom/Ignition/commit/b4c6cb72f688754d712fbb5955bcacd3c02a4a86){:target="_blank"} · Released by: [thecesrom](https://github.com/thecesrom){:target="_blank"} ### Added @@ -30,7 +29,6 @@ Visit the [release page](https://github.com/thecesrom/Ignition/releases/tag/v8.1 ## [8.1.4-jython](https://github.com/thecesrom/Ignition/releases/tag/v8.1.4-jython){:target="_blank"} - Repository: [thecesrom/Ignition](https://github.com/thecesrom/Ignition){:target="_blank"} · Tag: [v8.1.4-jython](https://github.com/thecesrom/Ignition/releases/tag/v8.1.4-jython){:target="_blank"} · Commit: [2632b83](https://github.com/thecesrom/Ignition/commit/2632b83f78af7b69dd867371607f34d61e23accb){:target="_blank"} · Released by: [thecesrom](https://github.com/thecesrom){:target="_blank"} ### Added @@ -45,4 +43,4 @@ This release has 3 assets: - Source code (zip) - Source code (tar.gz) -Visit the [release page](https://github.com/thecesrom/Ignition/releases/tag/v8.1.4-jython){:target="_blank"} to download them. \ No newline at end of file +Visit the [release page](https://github.com/thecesrom/Ignition/releases/tag/v8.1.4-jython){:target="_blank"} to download them. diff --git a/_posts/2021-04-29-ignition-8-1-5-release.md b/_posts/2021-04-29-ignition-8-1-5-release.md index be90363..69e2cd4 100644 --- a/_posts/2021-04-29-ignition-8-1-5-release.md +++ b/_posts/2021-04-29-ignition-8-1-5-release.md @@ -14,10 +14,10 @@ date: 2021-04-29 11:58 -0700 - Added [system.perspective.navigateForward](https://docs.inductiveautomation.com/display/DOC81/system.perspective.navigateForward){:target="_blank"} and [system.perspective.navigateBack](https://docs.inductiveautomation.com/display/DOC81/system.perspective.navigateBack){:target="_blank"} scripting methods, which operate similar to a browsers forward and back functions. - The [system.perspective.navigate](https://docs.inductiveautomation.com/display/DOC81/system.perspective.navigate){:target="_blank"} function now has a newTab parameter, which opens contents in a new tab. -
+--- Additionally I'd like to announce the release of [Ignition 8.1.5](https://github.com/thecesrom/Ignition/releases/tag/v8.1.5){:target="_blank"}, and [Ignition 8.1.5-jython](https://github.com/thecesrom/Ignition/releases/tag/v8.1.5-jython){:target="_blank"} for the [Ignition](https://github.com/thecesrom/Ignition){:target="_blank"} GitHub repo. Feel free to clone it, fork it, or simply download the source. -Happy coding! \ No newline at end of file +Happy coding! diff --git a/_posts/2021-05-26-the-one-liner-for-updating-pip-and-all-outdated-packages.md b/_posts/2021-05-26-the-one-liner-for-updating-pip-and-all-outdated-packages.md index 7a6f477..dfadd9a 100644 --- a/_posts/2021-05-26-the-one-liner-for-updating-pip-and-all-outdated-packages.md +++ b/_posts/2021-05-26-the-one-liner-for-updating-pip-and-all-outdated-packages.md @@ -24,7 +24,7 @@ Here are the top results provided by the most common search engines: And all of them agree on a command like this on Linux, macOS, or Git Bash for Windows: ```bash -$ pip freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install --upgrade +pip freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install --upgrade ``` And for PowerShell: @@ -40,20 +40,23 @@ Since `pip freeze` only outputs the installed packages in requirements format, b As for the recommended command to install or upgrade packages, I found that pip documentation suggests the following: To [install](https://pip.pypa.io/en/stable/cli/pip_install/){:target="_blank"} a package: + ```bash -$ python -m pip install black +python -m pip install black ``` And for [upgrading](https://pip.pypa.io/en/stable/installing/#upgrading-pip){:target="_blank"} a package: + ```bash -$ python -m pip install --upgrade pip +python -m pip install --upgrade pip ``` So, considering all of the above, this is what I ended up using: macOS: + ```bash -$ python -m pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 python -m pip install --upgrade +python -m pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 python -m pip install --upgrade ``` Windows: @@ -65,11 +68,13 @@ Windows: But of course I don't type those commands each and every time I am curious about checking for upgrades, so I recommend creating an alias on macOS, and a function on Windows PowerShell. Add this alias to your `.zshrc`: + ```bash alias pipu="python -m pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 python -m pip install --upgrade" ``` Add this to your `$PROFILE`: + ```powershell function global:Update-Pip { $packages = python -m pip list --outdated --format=freeze @@ -82,4 +87,4 @@ function global:Update-Pip { And that should do the trick. -Thanks for reading. \ No newline at end of file +Thanks for reading. diff --git a/_posts/2021-06-21-pre-commit-ci-and-pydocstyle-join-the-family.md b/_posts/2021-06-21-pre-commit-ci-and-pydocstyle-join-the-family.md index 3bef30f..d668220 100644 --- a/_posts/2021-06-21-pre-commit-ci-and-pydocstyle-join-the-family.md +++ b/_posts/2021-06-21-pre-commit-ci-and-pydocstyle-join-the-family.md @@ -72,4 +72,4 @@ So now I use `black`, `isort`, `flake8`, and `pydocstyle`, in that order as reco Lastly, if you can, please consider supporting Anthony Sottile via [GitHub Sponsors](https://github.com/sponsors/asottile) to show your appreciation. -Thanks for reading! \ No newline at end of file +Thanks for reading! diff --git a/_posts/2021-06-26-of-camels-and-snakes.md b/_posts/2021-06-26-of-camels-and-snakes.md index d6c2160..e15b5bb 100644 --- a/_posts/2021-06-26-of-camels-and-snakes.md +++ b/_posts/2021-06-26-of-camels-and-snakes.md @@ -10,6 +10,7 @@ date: 2021-06-26 23:06 -0700 This article was originally meant to be posted before [pre-commit.ci and pydocstyle join the family]({{ site.url }}/2021/06/21/pre-commit-ci-and-pydocstyle-join-the-family/), but it has now become part 4 of the series of articles about [coding standards]({{ site.url }}/tags/#coding standards). And while the last three articles have revolved around Python, this article is meant to be a bit broader. So, without further ado, welcome to part 4. As the title suggests, I will discuss the following programming naming conventions: + - [camelCase](#camelcase) - [snake_case](#snake_case) - [PascalCase](#PascalCase) @@ -116,14 +117,16 @@ Lately, I've written code in Python and SQL more than anything else, so pardon m Thanks for reading! ### Other resources + Bertrand, Aaron (2016-01-18). [Subjectivity: Naming Standards](https://www.sentryone.com/blog/aaronbertrand/subjectivity-naming-standards). SentryOne. Sarkuni, Sehrope (2014-02-16). [How I Write SQL, Part 1: Naming Conventions](https://launchbylunch.com/posts/2014/Feb/16/sql-naming-conventions/). Launch by Lunch. ### References + [^1]: [Camel case](https://en.wikipedia.org/wiki/Camel_case). Wikipedia. [^2]: [C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions). Microsoft Docs. [^3]: [Code Conventions for the Java Programming Language - Naming Conventions](https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html). Oracle. [^4]: [Snake case](https://en.wikipedia.org/wiki/Snake_case). Wikipedia. [^5]: [Kebab case](https://textcaseconvert.com/blog/kebab-case/). Text Case Convert. [^6]: [Hungarian notation](https://en.wikipedia.org/wiki/Hungarian_notation). Wikipedia. -[^7]: [Pylint User Manual](https://pylint.pycqa.org/en/latest/). PyCQA. \ No newline at end of file +[^7]: [Pylint User Manual](https://pylint.pycqa.org/en/latest/). PyCQA. diff --git a/_posts/2021-06-28-how-to-add-python-installed-via-homebrew-to-pyenv-versions.md b/_posts/2021-06-28-how-to-add-python-installed-via-homebrew-to-pyenv-versions.md index c671b7d..54e8b30 100644 --- a/_posts/2021-06-28-how-to-add-python-installed-via-homebrew-to-pyenv-versions.md +++ b/_posts/2021-06-28-how-to-add-python-installed-via-homebrew-to-pyenv-versions.md @@ -21,8 +21,8 @@ So here I will share a quick guide on how I accomplished that. 1. If you've installed the latest Python `3.9` version via `pyenv`, uninstall it by running `uninstall` and then `rehash` ```bash - $ pyenv uninstall 3.9.X - $ pyenv rehash + pyenv uninstall 3.9.X + pyenv rehash ``` 1. Create a `symlink` at `~/.pyenv/versions` @@ -79,7 +79,7 @@ So here I will share a quick guide on how I accomplished that. 1. Once that's done, run `pyenv rehash` as recommended by `pyenv` whenever you install new versions ```bash - $ pyenv rehash + pyenv rehash ``` 1. Now, you're ready to verify all versions managed by `pyenv`, and select a `global`, `local`, or `shell` version @@ -91,14 +91,14 @@ So here I will share a quick guide on how I accomplished that. 3.9 ``` -1. If you want to set `3.9` as global, just run by running - +1. If you want to set `3.9` as global, just run by running + ```bash - $ pyenv global 3.9 + pyenv global 3.9 ``` 1. Verify your selection by running - + ```bash $ pyenv versions system @@ -115,4 +115,4 @@ So here I will share a quick guide on how I accomplished that. And that's it! You've done it! -Thanks for reading and happy coding! \ No newline at end of file +Thanks for reading and happy coding!