curl -fsSL https://get.docker.com/ | sh
sudo docker run hello-world
sudo docker ps
| function filter(element, selector) { | |
| var value = $(element).val().toUpperCase(); | |
| $(selector +" li").each(function () { | |
| if ($(this).text().toUpperCase().indexOf(value)> -1) { | |
| $(this).show(); | |
| } else { | |
| $(this).hide(); | |
| } | |
| }); | |
| } |
| # https://github.com/aykut/django-bulk-update | |
| from django_bulk_update.helper import bulk_update | |
| from minhaapp.models import MeuModelo | |
| queryset_meumodelo = MeuModelo.objects.all() | |
| # limpa os dados | |
| for meumodelo_obj in queryset_meumodelo: |
| """ | |
| Respondendo a questões feitas no grupo da live de Python. | |
| """ | |
| class Teste: | |
| bananas_cls = 5 # Variável de classe | |
| def __init__(self): | |
| """Método que inicia a instância.""" | |
| self.bananas_self = 10 # Variável de instância |
Tested only on Ubuntu 24.04, KDE Neon User Edition (based on Ubuntu 24.04) and OSX Mojave or higher.
will probably work on other newer versions, with no changes, or with few changes in non-python dependencies (apt-get packages)
NOTE: Don't create a .sh file and run it all at once. It may will not work. Copy, paste, and execute each command below manually. :-)
# DO NOT RUN THIS AS A ROOT USER| // Bootstrap datepicker | |
| $('.input-daterange input').each(function() { | |
| $(this).datepicker('clearDates'); | |
| }); | |
| // Set up your table | |
| table = $('#my-table').DataTable({ | |
| paging: false, | |
| info: false | |
| }); |
| from ast import literal_eval | |
| def convert_to_type(input_data): | |
| try: | |
| return literal_eval(input_data) | |
| except (ValueError, SyntaxError): | |
| return input_data |
BY: Edd Yerburgh
Slides: https://slides.com/eddyerburgh/testing-a-vuex-store
Twitter: https://twitter.com/EddYerburgh
By: Diana Rodriguez
| def add_q_object(self, keyword, q_object, query_parm): | |
| for key in keyword: | |
| kwargs = {query_parm: key.strip()} | |
| q_object.add(Q(**kwargs), q_object.OR) | |
| def filter_applicants(self, _queryset=None): | |
| my_applicants = _queryset |
| """ | |
| Django ORM Optimization Tips | |
| Caveats: | |
| * Only use optimizations that obfuscate the code if you need to. | |
| * Not all of these tips are hard and fast rules. | |
| * Use your judgement to determine what improvements are appropriate for your code. | |
| """ | |
| # --------------------------------------------------------------------------- |