https://github.com/zedr/clean-code-python
Software engineering principles, from Robert C. Martin's book Clean Code , adapted for Python. This is not a style guide. It's a guide to producing
<mxfile host="app.diagrams.net" modified="2023-07-04T12:36:48.192Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.51" etag="U4EHGn_sUU4WP-Eq_T0W" version="21.5.2" type="device"> | |
<diagram name="Page-1" id="_bH2DKaN5ft4xbLNmIXA"> | |
<mxGraphModel dx="989" dy="580" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"> | |
<root> | |
<mxCell id="0" /> | |
<mxCell id="KdqZW1nxa3IcIuYSCLVA-135" parent="0" /> | |
<mxCell id="KdqZW1nxa3IcIuYSCLVA-362" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#E8E8E8;strokeColor=#828282;container=1;imageAspect=1;recursiveResize=0;fontFamily=sans-serif;" parent="KdqZW1nxa3IcIuYSCLVA-135" vertex="1"> | |
<mxGeometry x="700" y="800" width="140" height="130" as="geometry" /> | |
</mxCell> | |
<mxCell id="KdqZW1nxa3IcIuYSCLVA-357" value="Logical Volume" style="rou |
https://github.com/zedr/clean-code-python
Software engineering principles, from Robert C. Martin's book Clean Code , adapted for Python. This is not a style guide. It's a guide to producing
http://web.archive.org/web/20090918202746/http://tothink.com/mnemonic/wordlist.html
Select a random word:
curl -s https://gist.githubusercontent.com/mjnaderi/73d49c2431eae921340a788d8e6e56f9/raw/words | shuf -n 1
from django.contrib.auth.models import Permission | |
from django.db.models.deletion import ProtectedError | |
from django.contrib.contenttypes.models import ContentType | |
from django.db.models.deletion import Collector | |
def get_dependencies(obj): | |
collector = Collector(using="default") | |
collector.collect([obj]) | |
return collector.data |
""" | |
We used this script to migrate from gitlab.com to our self-hosted gitlab. | |
Author: Mohammad Javad Naderi | |
Before running the script, install `python-gitlab` package. | |
Important Note: | |
In order to keep the authors of merge requests and comments, before running this script make | |
sure all users have enabled "Public Email" in their gitlab.com profile and create account for | |
all users in self-hosted Gitlab (with the same e-mail address as their gitlab.com public email). |
Please note that storing compressed binary values inside database has its own disadvantage.
According to my experience using PostgreSQL, it increased the size of custom-format dump (pg_dump -Fc
) by 60%.
# You can run this turing machine in https://turingmachine.io/ | |
name: sum of two positive integers | |
source code: |+ | |
# Sum of two positive integers | |
# Demo for this talk: https://querateam.github.io/talks/presentations/Theory-of-Computation-1/ | |
input: '111110111' | |
blank: 0 | |
start state: s1 | |
table: | |
s1: |
# You can run this turing machine in https://turingmachine.io/ | |
name: multiply by two | |
source code: |- | |
# Multiply by two | |
# Demo for this talk: https://querateam.github.io/talks/presentations/Theory-of-Computation-1/ | |
input: '1111' | |
blank: 0 | |
start state: s1 | |
table: | |
s1: |
# You can run this turing machine in https://turingmachine.io/ | |
name: determine parity | |
source code: |- | |
# Determine Parity | |
# Demo for this talk: https://querateam.github.io/talks/presentations/Theory-of-Computation-1/ | |
input: '11111' | |
blank: 0 | |
start state: s1 | |
table: | |
s1: |
# You can run this turing machine in https://turingmachine.io/ | |
name: Print three strokes | |
source code: |- | |
# Print three strokes | |
# Demo for this talk: https://querateam.github.io/talks/presentations/Theory-of-Computation-1 | |
input: '' | |
blank: 0 | |
start state: s1 | |
table: | |
s1: |