sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: networking.k8s.io/v1 | |
| kind: Ingress | |
| metadata: | |
| name: dashboard-ingress | |
| namespace: kubernetes-dashboard | |
| annotations: | |
| kubernetes.io/ingress.class: "nginx" | |
| spec: | |
| defaultBackend: | |
| service: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import spacy, re, dateparser | |
| from spacy.matcher import Matcher | |
| from spacy.tokenizer import Tokenizer | |
| from spacy import displacy | |
| def custom_tokenizer(nlp, infix_reg): | |
| """ | |
| Function to return a customized tokenizer based on the infix regex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Hi traders, | |
| Here is a simple generic example for implementing a postback mechanism. You can host this in a remote server or in your local server itself. | |
| Run Locally | |
| =========== | |
| 1. Install ngrok from https://ngrok.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.db.models import Count, Max | |
| unique_fields = ['field_1', 'field_2'] | |
| duplicates = ( | |
| MyModel.objects.values(*unique_fields) | |
| .order_by() | |
| .annotate(max_id=Max('id'), count_id=Count('id')) | |
| .filter(count_id__gt=1) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Import EmailMessage class - https://docs.djangoproject.com/en/1.9/topics/email/#django.core.mail.EmailMessage | |
| from django.core.mail import EmailMessage | |
| email = EmailMessage('... Subject ...', '... Body ...', 'from-email', | |
| ['to-email-1', 'to-email-2'], ['bcc-email-1', 'bcc-email-2']) | |
| # now let's create a csv file dynamically | |
| import csv, StringIO | |
| attachment_csv_file = StringIO.StringIO() | |
| writer = csv.writer(attachment_csv_file) |