Skip to content

Instantly share code, notes, and snippets.

View AABur's full-sized avatar

Alexander Burchenko AABur

  • Dubai
  • 09:28 (UTC +04:00)
  • X @AABur
View GitHub Profile

Original https://brandonrozek.com/blog/pyenvtox/

Pyenv and Tox

Brandon Rozek February 21, 2020

Pyenv is great for managing multiple python installations and tox is great for creating virtual environments for testing. What if we can combine the two? For more detailed information visit Frank-Mich’s Blog.

First make sure pyenv is installed. In the directory with your setup.py tell pyenv which python versions you want to consider.

gh repo fork Hexlet/hexlet-sicp
git switch -c readme-update

Тут делаем полезные изменения, например в README.md

git push -u origin readme-update
gh pr create --title "update README.md" --body "Slightly updated Russian README"
@AABur
AABur / gist:289db29453b59b52bbbf74fc2d8f4a23
Last active February 19, 2022 10:06
heroku_data_sync.md
https://stackoverflow.com/questions/58908100/how-to-sync-local-django-sqlite3-data-with-herokus-postgres-database
Ok, I've figured it out.
First step is to run python3 manage.py dumpdata --exclude contenttypes > data.json. This copies the local database data into a file called data.json (that's created by > also if it doesn't exist).
Next, git push to heroku and run heroku run python3 manage.py migrate for good measure.
Finally, heroku run python3 manage.py loaddata data.json. This translates the data loaded from the local sqlite3 database and loads it to the heroku postgre database. Unless the translating is done when you dump the data. Regardless, this synchronizes the heroku data with the local data.
@AABur
AABur / SQL-order.md
Last active January 27, 2022 11:23
SQL-order

Порядок выполнения SQL-операций

SELECT genre.name, COUNT(*) 
FROM genre 
JOIN movie ON movie.genre_id = genre.id 
WHERE movie.rating > 3 
GROUP BY genre.id 
ORDER BY COUNT(*) DESC
HAVING COUNT(*) > 3

If you could check out this code for me and tell me what is wrong, that would be fantastic.

@AABur
AABur / mac_addrs.py
Created November 1, 2021 16:28 — forked from GhostofGoes/mac_addrs.py
Get MAC addresses using a variety of Python packages.
# **************************************
# ** Get MAC address of a remote host **
def arpreq_ip(ip):
# type: (str) -> Optional[str]
import arpreq
return arpreq.arpreq('192.168.1.1')
def scapy_ip(ip):
# type: (str) -> str
"""Requires root permissions on POSIX platforms.

San Sanych Yesterday at 00:50

Делаю 4 проект (Django)

На 3ем шаге. Уже есть форма регистрации, логин, список пользователей. Всё работало до...

Установил локально проект для образца вот из этого гайда Django Tutorial: The Local Library website https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django сам проект https://github.com/mdn/django-locallibrary-tutorial

форк,
клон,