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
FB_INSTANT_TOKEN = 'The token' | |
FB_PAGE_ID = 'The fb page id' | |
class FBInstantArticle: | |
def __init__(self, slug, published=False, development_mode=False): | |
self.page_token = FB_INSTANT_TOKEN | |
self.page_id = FB_PAGE_ID | |
self.host = 'https://graph.facebook.com/' | |
klass = import_class('article.models.Article') | |
self.article = get_obj(klass, slug=slug) |
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
Dynamic class Vue.js | |
div :class="['obj-' + obj.id]" style="float:right; color:red;" |
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
# First, install all of the things | |
sudo su | |
apt-get update | |
apt-get install nginx | |
/etc/init.d/nginx start | |
sudo apt-get install python-dev | |
sudo apt-get install python-pip | |
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main" | |
sudo apt update |
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
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" |
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
sudo apt-get install python3 python-dev python3-dev \ | |
build-essential libssl-dev libffi-dev \ | |
libxml2-dev libxslt1-dev zlib1g-dev \ | |
python-pip | |
pip install mysqlclient |
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
[Unit] | |
Description=Flower Celery Service | |
[Service] | |
User=admin | |
Group=www-data | |
WorkingDirectory=/home/sudipto/projects/project_name | |
ExecStart=/home/sudipto/venv/bin/celery -A proj flower --address=0.0.0.0 --port=5544 --loglevel=info | |
Restart=on-failure | |
Type=simple |
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
#!/bin/sh -e | |
# ============================================ | |
# celeryd - Starts the Celery worker daemon. | |
# ============================================ | |
# | |
# :Usage: /etc/init.d/celeryd {start|stop|force-reload|restart|try-restart|status} | |
# :Configuration file: /etc/default/celeryd (or /usr/local/etc/celeryd on BSD) | |
# | |
# See http://docs.celeryproject.org/en/latest/userguide/daemonizing.html#generic-init-scripts |
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
#!/bin/sh -e | |
# ========================================================= | |
# celerybeat - Starts the Celery periodic task scheduler. | |
# ========================================================= | |
# | |
# :Usage: /etc/init.d/celerybeat {start|stop|force-reload|restart|try-restart|status} | |
# :Configuration file: /etc/default/celerybeat or /etc/default/celeryd | |
# | |
# See http://docs.celeryproject.org/en/latest/userguide/daemonizing.html#generic-init-scripts |
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
# Dumpdata : Specific App | |
python manage.py dumpdata app > example.json | |
# Dumpdata : Specific Model | |
python manage.py dumpdata app.model > example.json | |
# Loaddata | |
python manage.py loaddata example.json | |
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
-- Creates the login AbolrousHazem with password '340$Uuxwp7Mcxo7Khy'. | |
CREATE LOGIN sudipto | |
WITH PASSWORD = 'Root1234'; | |
GO | |
-- Creates a database user for the login created above. | |
CREATE USER sudipto FOR LOGIN sudipto; | |
GO |
OlderNewer