A quick way to comment/uncomment lines in 
Put your cursor on the first # character, press
For commenting a block of text is almost the same:
- First, go to the first line you want to comment, press
- Then using the arrow key and select until the last line.
- Now press
- Then press
#vim #comment #comment_out #visual_block
  vim:Put your cursor on the first # character, press
Ctrl+V, and go down until the last commented line and press x, that will delete all  the # characters vertically.For commenting a block of text is almost the same:
- First, go to the first line you want to comment, press
Ctrl+V. This will put the editor in the VISUAL BLOCK mode.- Then using the arrow key and select until the last line.
- Now press
Shift+I, which will put the editor in INSERT mode and then press #. This will add a hash to the first line.- Then press
Esc (give it a second), and it will insert a # character on all other selected lines.#vim #comment #comment_out #visual_block
Stay tuned for the 
Happy coding ✌💥💫
  Django video tutorials for the weekend. Yay!!!Happy coding ✌💥💫
این رازِ پُر از عذاب پیشت باشد
تصویر من خراب پیشت باشد
شاید که اربعینت نبودم آقا !
این اشک علی الحساب پیشت باشد
😭😭😭😭
  تصویر من خراب پیشت باشد
شاید که اربعینت نبودم آقا !
این اشک علی الحساب پیشت باشد
😭😭😭😭
سائلم ؛ آب و دانه میخواهم
رحمت" مادرانه" میخواهم
آی "بی بی" گدا نمیخواهی!؟
پسر بی وفا نمیخواهی!؟😭😭😭
کاش میشد ز من سوال کنی
پسرم کربلا نمیخواهی!؟
پسر بی وفا نمیخواهی 😭😭😭
  رحمت" مادرانه" میخواهم
آی "بی بی" گدا نمیخواهی!؟
پسر بی وفا نمیخواهی!؟😭😭😭
کاش میشد ز من سوال کنی
پسرم کربلا نمیخواهی!؟
پسر بی وفا نمیخواهی 😭😭😭
Media is too big
    VIEW IN TELEGRAM
  Routes implementation in `Django` and how to wire routes & views
#python #django #route #view #django_part8
  #python #django #route #view #django_part8
In 
 
 
Now lets say you want to get count of files which is listed by
 
Now you shoud the count of files listed by the first command. This method of using 2 commands is
#linux #sysadmin #ls #wc #command #bash #terminal
  ls you can list files by using regex pattern as below:ls data.subtitle_*
* is gready and list all the files that start with data.subtitle_.Now lets say you want to get count of files which is listed by
ls command. For that you can use wc -l as follow:ls data.subtitle_* | wc -l
Now you shoud the count of files listed by the first command. This method of using 2 commands is
piping commands, which is in fact   separated by | (pipe)#linux #sysadmin #ls #wc #command #bash #terminal
tr command in Linux can be used to trim special characters from a string in bash script. Let's say we want to remove underscore (_)  from the string _hello_:$ echo "_hello_" | tr -d "_"As you can see the output is
hello
hello.-d flag causes to delete _ from the whole string.In case you want to delete multiple special characters, that's easy as pie:
$ echo "_sal-am_" | tr -d "_-"
salam
We have removed - and _ from the string above.
Making lower case to uppercase:
tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
asdasd
ASDASD
OR:
tr [:lower:] [:upper:]
asdasd
ASDASD
Turn {} into ():
$ echo '{hello}' | tr '{}' '()'
 (hello)#linux #tr #translate #trim #bash #sysadmin
Preventing installation of 
 
In global mode (ie, with
By default, npm install will install all modules listed as dependencies in
With the
#node #npm #package_json #devDependencies #NODE_ENV
  devDependencies node modules:npm install in the package directory installs the dependencies in the local node_modules folder.In global mode (ie, with
-g or --global appended to the command), it installs the current package context (ie, the current working   directory) as a global package.By default, npm install will install all modules listed as dependencies in
package.json.With the
--production flag (or when the NODE_ENV environment variable is set to production`), `npm will not install modules        listed in devDependencies.#node #npm #package_json #devDependencies #NODE_ENV
Did you know that you can apply 
 
This is a simple class that sets a fake lesson in your class and insert a new lesson.
 
As you can see above we have used
 
 
#python #class #builtin #len #__len__
  len python function on your classes? Let's say you have a Lessons class and when a use use len() function on your class it should return number of lessons inside of your class. For our sample let's say we have the below class:class Lessons(object):
def __init__(self, lessons=0):
self.lessons = lessons
def insert(self, data):
# let's assume we have save data in database
self.lessons += 1
def __len__(self):
return self.lessons
This is a simple class that sets a fake lesson in your class and insert a new lesson.
std_lessons = Lessons(1)
print len(std_lessons) # output: 1
std_lessons.insert({})
print len(std_lessons) # output: 2
As you can see above we have used
len on our class itself. In case you don't implemet __len__ on your class and use len() on it, there will be an AttributeError:len(std_no_len)
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: Lessons instance has no attribute '__len__'
__len__ is built-in class and can be implemented in different scenarios. There are tons of built-in functions that you can master and use to improve code quality and prove that you are professional.#python #class #builtin #len #__len__
Did you know that the most easiest way to start a simple HTTP server using python is just a command?
 
 
#python #SimpleHTTPServer #server
  $ python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
SimpleHTTPServer is a python module that serve all the data that is present inside of the current directory. Install this package    and enjoying playing around :)#python #SimpleHTTPServer #server
Sometimes to know your IP address, you have to open a web browser and open a site that gives you the ip address of your system. But    what if you are a 
Get your IP address from command line using
 
#linux #sysadmin #curl #ifconfig #ip #ip_address #ipv4
  sysadmin and you don't have access to a browser on Linux server? What if you don't wanna leave your terminal?Get your IP address from command line using
curl:$ curl ifconfig.co
80.171.524.14
#linux #sysadmin #curl #ifconfig #ip #ip_address #ipv4
In order to extract only text from an HTML website in the most robust way without using 
 
Usage in terminal is:
 
If you want it to use inside of your
 
#python #html2text #github #html #text
  regex or urlib or so, use the python       library below:https://github.com/aaronsw/html2text
Usage in terminal is:
Usage: html2text.py [(filename|url) [encoding]]
If you want it to use inside of your
python code:import html2text
print html2text.html2text("<p>Hello, world.</p>")
#python #html2text #github #html #text
More about 
If you want to set a variable named
 
If you want to include a partial template (child template) into your parent template use
 
 
If one of your templates inherits from a main layout use
 
#python #jinja2 #extends #include #set #variable #set_variable #layout
  jinja2:If you want to set a variable named
button:{% set button = 'Login' %}If you want to include a partial template (child template) into your parent template use
include:{% include 'fa.button.tpl' %}BE CAREFUL that we have used {% NOT {{ for the code block.If one of your templates inherits from a main layout use
extends directive:{% extends "layout.tpl" %}#python #jinja2 #extends #include #set #variable #set_variable #layout
In python when you open a file using 
 
 
 
For reading lines from a file, you can loop over the file object. This is memory efficient, fast, and leads to simple code:
 
#python #file #read #readline #efficiency
  open command the your can read the content of the file. read will read the whole content of   the file at once, while readline reads the content of the file line by line.NOTE: if file is huge, read() is definitely a bad idea, as it loads (without size parameter), whole file into memory.NOTE: it is good practice to use the with keyword when dealing with file objects. The advantage is that the file is properly       closed after its suite finishes, even if an exception is raised at some point. (We have reviewed with in depth a couple days ago)NOTE: read function gets a size parameter that specifies the chunks read from a file. If the end of the file has been reached,   f.read() will return an empty string.For reading lines from a file, you can loop over the file object. This is memory efficient, fast, and leads to simple code:
>>>
>>> for line in f:
... print(line, end='')
...
This is the first line of the file.
Second line of the file
#python #file #read #readline #efficiency
  Tech C**P
with python compound statement in depth [ADVANCE]:   with is ported into python in version 2.5.   with is used to wrap the execution of a code block using methods defined by a context manager.   The process of with statement:      - The expression given in…
In case you have missed 
  with tutorial read this post, which is related to the previous post.