1. Install nginx
2. Install minio
3. Install mc client
$ mc mb myminio/static
Bucket created successfully ‘myminio/static’.
| # coding: utf-8 | |
| """Cause git to detect a merge conflict when two branches have migrations.""" | |
| # myapp/management/commands/makemigrations.py | |
| # you'll need myapp/management/commands/__init__.py and myapp/management/__init__.py in PY2, see Django docs | |
| from __future__ import absolute_import, unicode_literals | |
| import io | |
| import os | |
| import six |
| import express from 'express'; | |
| import { ApolloServer } from 'apollo-server-express'; | |
| import { ApolloServerPlugin } from 'apollo-server-plugin-base'; | |
| import * as Sentry from '@sentry/node'; | |
| Sentry.init({ | |
| environment: process.env.APP_ENV, | |
| // see why we use APP_NAME here: https://github.com/getsentry/sentry-cli/issues/482 | |
| release: `${process.env.APP_NAME}-${process.env.APP_REVISION}` || '0.0.1', | |
| dsn: process.env.SENTRY_DSN, |
| # Redis Cheatsheet | |
| # All the commands you need to know | |
| redis-server /path/redis.conf # start redis with the related configuration file | |
| redis-cli # opens a redis prompt | |
| # Strings. |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
| <!-- | |
| Noto Mono + Color Emoji Font Configuration. | |
| Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole. | |
| Usage: | |
| 0. Ensure that the Noto fonts are installed on your machine. | |
| 1. Install this file to ~/.config/fontconfig/conf.d/99-noto-mono-color-emoji.conf |
| # import config. | |
| # You can change the default config with `make cnf="config_special.env" build` | |
| cnf ?= config.env | |
| include $(cnf) | |
| export $(shell sed 's/=.*//' $(cnf)) | |
| # import deploy config | |
| # You can change the default deploy config with `make cnf="deploy_special.env" release` | |
| dpl ?= deploy.env | |
| include $(dpl) |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
| #!/bin/bash | |
| compose_file_path=$1 | |
| project_name=$2 | |
| backup_path=$3 | |
| function backup_volume { | |
| volume_name=$1 | |
| backup_destination=$2 |
| from sqlalchemy import event, and_ | |
| from sqlalchemy.orm import relationship, foreign, remote, backref | |
| class PostFavorites(db.Model): | |
| id = db.Column(db.Integer, primary_key=True, nullable=False) | |
| user_id = db.Column(db.Integer, nullable=False) | |
| post_id = db.Column(db.Integer, nullable=False) |