Skip to content

Instantly share code, notes, and snippets.

View sheminanto's full-sized avatar
✍️
Learning

Shemin Anto sheminanto

✍️
Learning
View GitHub Profile
@sheminanto
sheminanto / postman-set-csrf-token.js
Created November 24, 2022 10:40
Postman pre-request script to set csrf token as a variable before every requests
pm.sendRequest({
url: "localhost:3000/",
method: "GET",
header :{
"accept": "*/*",
}
},(err, res)=> {
const $ = cheerio.load(res.text());
const csrfToken = $("meta[name='csrf-token']").attr("content");
pm.collectionVariables.set("xsrf-token", csrfToken);
@sheminanto
sheminanto / generate-random-colour-for-status.html
Last active November 24, 2022 10:21
Generate random colours for status's
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div id="status">currentStatus</div>
@sheminanto
sheminanto / get-most-similar-base-colour.html
Last active November 24, 2022 10:20
To find the most similar base colour for any random colour (Javascript)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
@sheminanto
sheminanto / env.py
Last active April 30, 2021 05:56
Alembic Settings to Make Migrations Automatically from Models (SQLAlchemy)
from alembic import context
from sqlalchemy import pool
from sqlalchemy import engine_from_config
from logging.config import fileConfig
import os
import sys
sys.path.append(os.getcwd())