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
| .parrent { | |
| scroll-snap-type: x mandatory; | |
| overflow-x: scroll; | |
| display: grid; | |
| grid-template-columns: repeat(3, 100%) | |
| } | |
| .child { | |
| padding: 3em; | |
| width: calc(100vw - 6em); | |
| scroll-snap-align: start; |
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.4' | |
| services: | |
| consul-leader: | |
| image: consul | |
| command: agent -server -client=0.0.0.0 -bootstrap -ui | |
| volumes: | |
| - consul-data-leader:/consul/data | |
| environment: | |
| - CONSUL_BIND_INTERFACE=eth0 |
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
| import React from "react"; | |
| import { useQuery, gql } from "@apollo/client"; | |
| const ALL_METALS = gql` | |
| { | |
| golds { | |
| id | |
| date | |
| price | |
| source |
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' | |
| services: | |
| strapi: | |
| container_name: strapi | |
| image: strapi/strapi | |
| environment: | |
| - DATABASE_CLIENT=postgres | |
| - DATABASE_HOST=db | |
| - DATABASE_PORT=5432 |
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
| # from Youtube video: https://youtu.be/51RpDZKShiw | |
| #connecting | |
| from sqlalchemy import create_engine | |
| engine = create_engine('sqlite:///:memory: ') | |
| #establishing a session - provides identity map: app objects - DB | |
| from sqlalchemy.orm import sessionmaker | |
| Session = sessionmaker(bind=engine) | |
| session = Session() | |
| # MODEL BASE |
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
| ### RUN NGINX PROXY CONTAINER | |
| docker run --detach --name nginx-proxy --publish 80:80 --publish 443:443 --volume /etc/nginx/certs --volume /etc/nginx/vhost.d --volume /usr/share/nginx/html --volume /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy | |
| docker run | |
| --detach | |
| --name nginx-proxy | |
| --publish 80:80 | |
| --publish 443:443 | |
| --volume /etc/nginx/certs | |
| --volume /etc/nginx/vhost.d |
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
| #You could deploy Nginx in front of the CherryPy servers to act as a reverse proxy and direct traffic. Basically, you’d need to have the CherryPy servers listen on some random port on localhoast, then configure Nginx to pass requests to those ports based on domain names. | |
| <pre> | |
| upstream first_server { | |
| server 127.0.0.1:3000; | |
| } | |
| upstream second_server { | |
| server 127.0.0.1:4000; | |
| } |
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
| # Define the method for create new user and get user by username | |
| from sqlalchemy.orm import Session | |
| from . import models, schemas | |
| def get_user_by_username(db: Session, username: str): | |
| return db.query(models.UserInfo).filter(models.UserInfo.username == username).first() | |
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
| import React from "react"; | |
| import TextInput from "./common/TextInput"; | |
| import PropTypes from "prop-types"; | |
| function Form(props) { | |
| return ( | |
| <form onSubmit={props.onSubmit}> | |
| <TextInput | |
| id="title" | |
| label="Title" |