Skip to content

Instantly share code, notes, and snippets.

@fataltrace
fataltrace / ecosystem.json
Created June 11, 2021 14:27 — forked from zubair1024/ecosystem.json
Running PM2 as a window service
{
"apps": [
{
"name": "web",
"script": "C:\\ws\\engineer\\titan-web\\app.js",
"args": [],
"cwd": "C:\\ws\\engineer\\titan-web",
"merge_logs": true,
"instances": 1,
"exec_mode": "cluster_mode",
@fataltrace
fataltrace / tokens.md
Created March 8, 2021 21:18 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@fataltrace
fataltrace / adfs.sh
Last active May 21, 2020 15:29
ADFS token
#!/usr/bin/env bash
set -e
PROG="$(basename "$0")"
printUsage() {
echo "Usage: $PROG ENTITY-ID ENDPOINT-URL"
echo ""
echo "Example:"
echo " $PROG urn:someservice https://sp.example.org/mellon"
@fataltrace
fataltrace / gist:bd07da6432d32adfb18a7427f17ee1cd
Created December 30, 2019 13:31 — forked from trongthanh/gist:2779392
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.
@fataltrace
fataltrace / package.json
Last active August 3, 2016 18:07
AngularJS + Webpack
{
"name": "public",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
".": ""
},
"author": "LeX",
"license": "ISC",
@fataltrace
fataltrace / file.html
Created March 9, 2016 13:20
Print from Iframe
static print (url, data = {}, isPost = false) {
let printPageName = 'printPage';
let printPageUrl = isPost ? '' : url;
let printPage = $(`<iframe src="${ printPageUrl }" name="${ printPageName }"
style="display: none; @media print { display: block; }">`);
GLOBAL.body.append(printPage);
if (isPost) {
let form = $(`<form action="${ printPageUrl }" method="post" target="${ printPageName }"