A brief example on how to use npx to run gist based scripts.
Read the article here https://neutrondev.com/npm-vs-npx-whats-the-difference/ or watch it on YouTube https://www.youtube.com/watch?v=fSHWc8RTJug
| # Serve nextJS app from a port through NGINX reverse proxy (HTTP) | |
| # Path: /etc/nginx/sites-available/default | |
| # Default server configuration for HTTP | |
| server { | |
| server_name www.DOMAINNAME.com DOMAINNAME.com; | |
| # Serve any static assets with NGINX | |
| location /_next/static { | |
| alias /home/ubuntu/PROJECT_FOLDER/.next/static; |
| if Code.ensure_loaded?(Ecto.Type) do | |
| defmodule Bitstring do | |
| @moduledoc """ | |
| Implements the Ecto.Type behaviour for the Postgres | |
| type "bit varying" | |
| """ | |
| use Ecto.Type |
A brief example on how to use npx to run gist based scripts.
Read the article here https://neutrondev.com/npm-vs-npx-whats-the-difference/ or watch it on YouTube https://www.youtube.com/watch?v=fSHWc8RTJug
| defmodule ApiDataStructure do | |
| defmodule User do | |
| use Ecto.Schema | |
| import Ecto.Changeset | |
| alias ApiDataStructure.Profile | |
| embedded_schema do | |
| field :username, :string |
| # | |
| # cqlsh_intro.cql | |
| # | |
| # Copyright (C) 2017 Jeff Carpenter | |
| # Execute the commands in this file for a short guided tour of the CQL Shell (cqlsh) | |
| # | |
| # For more description, see Cassandra, The Definitive Guide 2nd Ed., Chapter 3: Installing | |
| # http://shop.oreilly.com/product/0636920043041.do | |
| # |
| ncat -C httpbin.org 80 | |
| GET /anything HTTP/1.1 | |
| Host: httpbin.org | |
| HTTP/1.1 200 OK | |
| Access-Control-Allow-Credentials: true | |
| Access-Control-Allow-Origin: * | |
| Content-Type: application/json | |
| Date: Mon, 24 Jun 2019 17:32:44 GMT | |
| Referrer-Policy: no-referrer-when-downgrade |
| Process.info(self(), :current_stacktrace) |
| Создайте базу данных test_guru | |
| ------------------------------ | |
| postgres=# CREATE DATABASE test_guru; | |
| CREATE DATABASE | |
| postgres=# |
| MacBook-Air-Artem:~ alucard_yanas$ ncat -C httpbin.org 80 | |
| GET /anything?arg1=25 HTTP/1.1 | |
| Host: httpbin.org | |
| HTTP/1.1 200 OK | |
| Access-Control-Allow-Credentials: true | |
| Access-Control-Allow-Origin: * | |
| Content-Type: application/json | |
| Date: Thu, 14 Mar 2019 14:23:27 GMT | |
| Server: nginx |
| C:\Program Files (x86)\Nmap>ncat httpbin.org 80 -C | |
| POST /anything HTTP/1.1 | |
| Host: httpbin.org | |
| Content-Length: 8 | |
| vint=258 | |
| HTTP/1.1 200 OK | |
| Access-Control-Allow-Credentials: true | |
| Access-Control-Allow-Origin: * | |
| Content-Type: application/json |