db.votes.aggregate([{
$lookup: {
from: "users",
localField: "createdBy",
foreignField: "_id",
π
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
| # docs for more information see the official HPLIP project site here. | |
| # https://developers.hp.com/hp-linux-imaging-and-printing | |
| # Step 1. Update Fedora Linux | |
| # Simply run dnf command: | |
| $ sudo dnf upgrade | |
| # Step 2. Search for HPLIP software |
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 |