Skip to content

Instantly share code, notes, and snippets.

View psylone's full-sized avatar
💭
Be kind; everyone you meet is fighting a hard battle

Evgeniy Fateev psylone

💭
Be kind; everyone you meet is fighting a hard battle
View GitHub Profile
@iam-hussain
iam-hussain / default HTTP
Last active September 29, 2024 17:15
Serve nextJS app from a port through NGINX reverse proxy HTTP and HTTPS
# 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
@Tynael
Tynael / README.md
Last active October 9, 2024 22:42
How to use npx to run gist based scripts
@char0n
char0n / api_data_structure.ex
Last active August 1, 2022 16:03
Model example how to use Ecto to validate nested JSON data in you API payloads
defmodule ApiDataStructure do
defmodule User do
use Ecto.Schema
import Ecto.Changeset
alias ApiDataStructure.Profile
embedded_schema do
field :username, :string
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
@koolquark
koolquark / stack_trace.ex
Created June 21, 2019 15:42
Get Current Stack Trace in Elixir
Process.info(self(), :current_stacktrace)
Создайте базу данных test_guru
------------------------------
postgres=# CREATE DATABASE test_guru;
CREATE DATABASE
postgres=#
@AlucardYanas
AlucardYanas / gist:1c32039fb8144899e347561638559fb7
Created March 16, 2019 22:21
Задание к уроку "Архитектура клиент-сервер и HTTP ghjnjrjk@
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
@Sandstorm750
Sandstorm750 / post3
Created March 15, 2019 20:42
POST3
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
@Sandstorm750
Sandstorm750 / gistnum3
Created March 15, 2019 20:01
GET + Params
C:\Program Files (x86)\Nmap>ncat httpbin.org 80 -C
GET /anything?time_continue=5&v=KlZv4MSF5I8 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: Fri, 15 Mar 2019 19:59:18 GMT
Server: nginx