db.votes.aggregate([{
$lookup: {
from: "users",
localField: "createdBy",
foreignField: "_id",
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
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
""" | |
Service API: | |
public string GetCurrency(Currency cur) აბრუნებს ვალუტის კურსს, მაგ. "1.0754" | |
public string GetCurrencyDescription(Currency cur) აბრუნებს ვალუტის აღწერას, მაგ. "10 ესტორნური კრონი" | |
public string GetCurrencyChange(Currency cur) აბრუნებს ვალუტის ცვლილების მნიშვნელობას, მაგ. "-0.0121" | |
public int GetCurrencyRate(Currency cur) 1 - თუ გაიზარდა; -1 - თუ დაიკლო, 0 - თუ იგივე დარჩა | |
public string GetDate() აბრუნებს კურსების შესაბამის თარიღს | |
""" |
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
# old django version: 1.6.x | |
# configure and run django script | |
if __name__ == '__main__': | |
import os | |
import sys | |
import importlib | |
proj_path = '/home/gogua/projects/profenv/profiling/' | |
sys.path.append(proj_path) |
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
# Python 2.x | |
for x in [unichr(i) for i in range(ord(u'ა'),ord(u'ჰ') +1)]: | |
pattern = unicode("!@#$%^&*()_+=-~`[]\{}|:\"?><,./;'\`„\"") | |
char = re.sub('[%s]' % re.escape(''.join(pattern)), '', x.strip()) | |
print char | |
# Python 3.x | |
for x in [chr(i) for i in range(ord('ა'),ord('ჰ') +1)]: | |
pattern = "!@#$%^&*()_+=-~`[]\{}|:\"?><,./;'\`„\"" |
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
#models.py | |
class Task(models.Model): | |
title = models.CharField(max_length=255) | |
description = models.TextField() | |
def __unicode__(self): | |
return self.title | |
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
# _*_ coding: utf-8 _*_ | |
""" | |
IPC | |
Created on Apr 24, 2017 | |
@author: lasha gogua | |
""" | |
from django import forms |
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
1. django (latest version) | |
$ pip install django | |
2. celery (latest version) | |
$ pip install celery | |
first steps | |
docs: http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html | |
install celery extension | |
$ pip install django-celery-beat | |
docs: http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html#django-celery-beat |
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
# ubutnu/debian Python installation requirements | |
sudo apt -y install build-essential checkinstall | |
sudo apt -y install libreadline-gplv2-dev libncursesw5-dev \ | |
libsqlite3-dev tk-dev libgdbm-dev libc6-dev | |
sudo apt -y install libjpeg-dev libpng-dev | |
sudo apt -y install zlib1g-dev libbz2-dev | |
sudo apt -y install krb5-multidev | |
sudo apt -y install openssl libssl-dev | |
sudo apt -y install libffi-dev | |
sudo apt -y install libgmp-dev |