create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
__all__ = ( | |
'ALL_CURRENCIES', 'ALL_CURRENCIES_LIST', 'ALLOWED_CURRENCIES', | |
'CURRENCIES', 'CURRENCIES_LIST', | |
) | |
from pycountry import currencies | |
# Getting a list of all currencies to be used in Django | |
ALL_CURRENCIES = {c.letter: c.name for c in list(currencies)} | |
ALL_CURRENCIES_LIST = sorted(list(ALL_CURRENCIES.items()), key=lambda i: i[0]) |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
https://cloud.genymotion.com/page/launchpad/download/ | |
Download one | |
Move the downloaded file to ~/ | |
mv genymotion-2.5.2_x64_debian.bin ~/ | |
chmod +x ./genymotion-2.5.2_x64_debian.bin |
| 😄 | 😆 | 😊 | 😃 |
😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷
😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨
# -*- coding: utf-8 -*- | |
""" | |
Search features for : | |
* :mod:`elasticsearch.elasticsearch` | |
* :mod:`haystack:haystack` | |
* :mod:`elasticstack:elasticstack` | |
:creationdate: 05/11/15 15:05 | |
:moduleauthor: François GUÉRIN <fguerin@ville-tourcoing.fr> |
apt-get update && apt-get install -y curl && curl --silent https://bootstrap.pypa.io/get-pip.py |python3 && pip install --upgrade httpie |
This is an example how to perform multi-select faceting in ElasticSearch. | |
Selecting multiple values from the same facet will result in an OR filter between each of the values: | |
(facet1.value1 OR facet1.value2) | |
Faceting on more than one facet will result in an AND filter between each facet: | |
(facet1.value1 OR facet1.value2) AND (facet2.value1) | |
I have chosen to update the counts for each facet the selected value DOES NOT belong to since we are performing an AND between each facet. I have included an example that shows how to keep the counts if you don't want to do this (filter0.sh). |
Haystack provides an interface similar to Django's QuerySet
, which instead enables easy querying in one or more popular search backends. Because the Haystack SearchQuerySet
API is meant to hook up to several search backends, however, not all the functionality of the backends has been implemented in the API. In this article we show how Haystack's Elasticsearch backend can be extended with advanced querying functionality.
As an exemplary use case, we'll focus on implementing Elasticsearch's Nested Query in the SearchQuerySet
API, to enable e.g. weighted tags on documents. The usage of this extended API will be shown first, after which we'll go through the necessary implementation steps.
import search.custom_elasticsearch as ces
from files import FileObject
#!/bin/sh | |
echo | |
curl -XDELETE 'http://localhost:9200/items' | |
echo | |
curl -XPUT 'localhost:9200/items' -d ' | |
{ | |
"mappings" : { | |
"Item" : { | |
"dynamic" : false, |
# -*- mode: shell-script -*- | |
function kill_django { | |
# Assuming that Django runs on port 8000, we find | |
# the process with netstat and kill it. | |
DJANGO_PORT=':8000' | |
DJANGO_INFO=$(sudo netstat -ntlp | cat | grep $DJANGO_PORT) | |
#echo $DJANGO_INFO | |
DJANGO_PID_PROC=$(echo $DJANGO_INFO | cut -d ' ' -f 7-) | |
#echo $DJANGO_PID_PROC |