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
version: "3.1" | |
services: | |
wp-mysql: | |
image: bitnami/mysql:latest | |
container_name: ${PROJECT_NAME}-wp-mysql | |
volumes: | |
- wp-mysql-data:/bitnami/mysql/data | |
environment: | |
- MYSQL_USER=${WP_DB_USERNAME} |
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
server { | |
listen 80 default; | |
server_name localhost; | |
server_tokens off; | |
#charset koi8-r; | |
#access_log /var/log/nginx/host.access.log main; | |
location / { | |
root /usr/share/nginx/html; |
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
server { | |
listen 80; | |
listen 443 ssl http2; | |
server_tokens off; | |
server_name www.example.com; | |
ssl_certificate /etc/nginx/cert/example.pem; | |
ssl_certificate_key /etc/nginx/cert/example.key; | |
rewrite ^/(.*) https://example.com/$1 permanent; |
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
version: "3.1" | |
services: | |
nginx: | |
image: nginx | |
container_name: ${PROJECT_NAME}-webserver | |
tty: true | |
working_dir: /var/www | |
volumes: | |
- ssr_static:/var/www/ |
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
def paginate(repo, model, conn) do | |
sort = cond do | |
Map.has_key?(conn.query_params, "sort") -> | |
case conn.query_params["sort"] do | |
"desc" -> :desc | |
"asc" -> :asc | |
"ascending" -> :asc | |
"descending" -> :desc | |
_ -> :desc |
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
require Slugy | |
require Timex | |
def slugify(repo, model, params) do | |
slug = Slugy.slugify(params["title"]) | |
cond do | |
repo.get_by(model, slug: slug) == nil -> Map.put(params, "slug", slug) | |
true -> | |
ms = Timex.now |> DateTime.to_unix(:milliseconds) |> to_string |