Today I learned
Tags: python
Here, the heroe is tracemalloc
from the stdlib (>= python3.4).
#!/usr/bin/env python
# From: https://medium.com/python-features/understanding-memory-usage-and-leaks-in-our-python-code-beginners-c9dc211887af
import tracemalloc
tracemalloc.start(6)
time1 = tracemalloc.take_snapshot()
ref = 'Sarah ' * 51200000
time2 = tracemalloc.take_snapshot()
stats = time2.compare_to(time1, 'lineno')
for stat in stats:
print(stat)
print('\nWho is consuming more mem?:\n')
top = stats[0]
print('\n'.join(top.traceback.format()))
Tags: python
Install different python versions and use them like virtualenvs
. Also, it supports define which python version
do you want to use by application
, creating a .python-version
file in the current app/directory.
To create a .python-version
file, issue the command: pyenv local 3.8.0
Docs at: https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-local
Tags: graphql
Tags: graphql
How to use Hasura with Django, the eassy way: https://medium.com/free-code-camp/how-to-get-instant-graphql-apis-on-your-existing-django-application-c8fcfdb945aa
Tags: javascript
, vuejs
https://medium.com/swlh/how-to-add-server-side-rendering-to-vue-js-app-the-easy-way-a38fc32c9bf2
Tags: javascript
https://spin.atomicobject.com/2011/04/10/javascript-don-t-reassign-your-function-arguments/ http://bonsaiden.github.io/JavaScript-Garden/#function.arguments
Tags: typescript
, javascript
https://dev.to/wuz/getting-started-with-deno-e1m
Tags: git
Use git fetch -p origin
. It will delete locally all those branches that dont exists on origin anymore.