aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-02-14 12:46:55 +0100
committerneodarz <neodarz@neodarz.net>2019-02-14 12:47:21 +0100
commitbc3f5659576aa0d2803a4cd933079b1393537be5 (patch)
treefc9eb5aaf02c87f79823dc4f967cd22e2d5d44ca
parent59367698d3127d1a8c43cfa42d4bee04b24965d8 (diff)
downloaddotfiles_ascii-bc3f5659576aa0d2803a4cd933079b1393537be5.tar.xz
dotfiles_ascii-bc3f5659576aa0d2803a4cd933079b1393537be5.zip
Update some tips
-rw-r--r--cheat/.cheat/django12
-rw-r--r--cheat/.cheat/git4
-rw-r--r--cheat/.cheat/python25
-rw-r--r--cheat/.cheat/tips15
4 files changed, 56 insertions, 0 deletions
diff --git a/cheat/.cheat/django b/cheat/.cheat/django
index 5d25f15..ebb5817 100644
--- a/cheat/.cheat/django
+++ b/cheat/.cheat/django
@@ -17,3 +17,15 @@ python manage.py runserver 127.0.0.1:8000
# tinymce for django
https://github.com/romanvm/django-tinymce4-lite
+
+# For create a .po file for translation
+# first create a locale folder in module folder or edit LOCALE_PATH in conf file
+
+# run command for generate the file
+django-admin makemessages -l fr
+
+# update the file if there are new translation
+django-admin makemessages -l fr
+
+# compil translations files
+django-admin compilemessages
diff --git a/cheat/.cheat/git b/cheat/.cheat/git
index 8903fa2..9fad2c3 100644
--- a/cheat/.cheat/git
+++ b/cheat/.cheat/git
@@ -159,3 +159,7 @@ git push origin master:dreamer_theme
# Create bare repo shared
git init --bare --shared=group
+
+# This is maybe because type mistake !
+error: src refspec masster does not match any.
+error: failed to push some refs to 'ssh://bcorentin@192.168.1.45:8766/volume1/GIT/django-omrii.git'
diff --git a/cheat/.cheat/python b/cheat/.cheat/python
index e4f5d36..4428b48 100644
--- a/cheat/.cheat/python
+++ b/cheat/.cheat/python
@@ -17,3 +17,28 @@ python -mjson.tool
# Generate requirements.txt
pipreqs /path/to/project
+
+# Tips
+# Ressources available in : cheat python_ressources
+
+Input: décoder avec `decode()`.
+Output: encoder avec `encode('utf-8')`
+
+lors de l'ouverture d'un fichier:
+```
+from codecs import open
+
+# open() de codec à exactement la même API, y compris avec "with"
+f = open('fichier', encoding='encoding')
+```
+
+# Types
+
+bytes == bytearray
+
+# non mutable (non modifiable)
+bytes
+tuple
+
+# mutable (modifiable)
+bytearray
diff --git a/cheat/.cheat/tips b/cheat/.cheat/tips
index a378d4c..e648853 100644
--- a/cheat/.cheat/tips
+++ b/cheat/.cheat/tips
@@ -34,6 +34,21 @@ DRY - Don't Repeat Yourself
# Tips 12
Make It Easy to Reuse
+# Tips 13
+Eliminate Effects Between Unrelateed Things
+
+# Tips
+There Are No Final Decisions
+
+# Tips 15
+User Trace Bullets to Find the Target
+
+# Tips 16
+Prototype to Learn
+
+# Tips 17
+Program Close to the Problem Domain
+
### --- Other tips
# WISDOM acrostic - understanging an audience