Backup (clone) all your own gists

You need to have a personal access token to GitHub. In this script I use my token saved in ~/.github_access_token. Also you need to have the git utility on your system. Install PyGithub package to work with GitHub API pip install PyGithub The gist is actually a git repository. All your gists you can clone as regular repositories into a directory called repos. Script clones gists with names contained the IDs. Also script creates index.json which contains an array of objects describing what you got. ...

<span title='2022-03-13 00:00:00 +0000 UTC'>March 13, 2022</span>

How to push to GitHub via HTTPS if you have enabled two-factor authentication

If you enabled two-factor authentication in your Github account you won’t be able to push via HTTPS using your accounts password. Instead you need to generate a personal access token. This can be done in the application settings of your Github account. Using this token as your password should allow you to push to your remote repository via HTTPS. Use your username as usual. You may also need to update the origin for your repository if set to https: ...

<span title='2021-07-31 00:00:00 +0000 UTC'>July 31, 2021</span>

A dynamic GitHub profile with GitHub Actions

Thanks Yannick Chenot for the article How to Build a Dynamic GitHub Profile with GitHub Actions and PHP! It describes how to set up automatic updating of links to the latest blog posts in the GitHub profile using GitHub Actions. I will not retell the article, and you can read about the profile on GitHub here. Here is my python solution import requests from bs4 import BeautifulSoup url = "https://vostbur.github.io" main_page = BeautifulSoup(requests.get(url).content, "html.parser") content = f"### Last posts from [blog]({url}):\n\n" for article_div in main_page.find_all("div", {"class": "mb-4"}): article_url = article_div.find("a", href=True) content += f" - [{article_url.text}]({article_url['href']})\n" with open("README.md", "w", encoding="utf-8") as f: f.write(content) Yaml file for GitHub Actions ...

<span title='2021-07-22 00:00:00 +0000 UTC'>July 22, 2021</span>

Setup a basic workflow using GitHub Actions with Docker

In the continuation of the post “Creating dockerized Django app with VSCode”, I updated the source code to work with GitHub Actions. Setup a basic workflow using GitHub Actions Add to the requirements.txt file the following line to check with linter: flake8>=3.9.2,<3.10 Create a new file at .github/workflows/cd.yml and fill it with the following contents: --- name: Code checks on: push: branches: [ master ] pull_request: branches: [ master ] jobs: test: name: Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Test run: docker-compose run --rm . sh -c "python manage.py test" lint: name: Lint runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - name: Lint run: docker-compose run --rm . sh -c "flake8" To add a cool badge I updated README.md with the following link: ...

<span title='2021-06-13 00:00:00 +0000 UTC'>June 13, 2021</span>