Skip to content

Instantly share code, notes, and snippets.

View spac3unit's full-sized avatar

Denis spac3unit

View GitHub Profile
🌞 Morning 28 commits ██░░░░░░░░░░░░░░░░░░░ 9.9%
🌆 Daytime 94 commits ██████▉░░░░░░░░░░░░░░ 33.3%
🌃 Evening 113 commits ████████▍░░░░░░░░░░░░ 40.1%
🌙 Night 47 commits ███▍░░░░░░░░░░░░░░░░░ 16.7%
@spac3unit
spac3unit / unfollow-non-followers-twitter.js
Created November 11, 2021 20:02 — forked from YogaSakti/unfollow-non-followers-twitter.js
Code to stop following those ones who are not following you back on Twitter and keeping those you want or follow anyone you want, with certain filters (working in July 2019)
/*
Unfollow (stop following) those people who are not following you back on Twitter (or unfollow everyone if desired).
This will work for new Twitter web site code structure (it was changed from July 2019, causing other unfollow-scripts to stop working).
Instructions:
1) The code may need to be modified depending on the language of your Twitter web site:
* For English language web site, no modification needed.
* For Spanish language web site, remember to set the 'LANGUAGE' variable to "ES".
* For another language, remember to set the 'LANGUAGE' variable to that language and modify the 'WORDS' object to add the words in that language.
@spac3unit
spac3unit / massa.sh
Created November 11, 2021 20:01 — forked from YogaSakti/massa.sh
massa auto buy roll
#!/bin/bash
DELAY=300 #in secs - how often restart the script
ROLL_PRICE=100
for (( ;; )); do
WALLET=$(massa-client wallet_info)
ADDRESS=$(echo -e $WALLET | grep -oP 'Address:\s*\K.*(?=\s+State)')
FINAL_BAL=$(echo -e $WALLET | grep -oP 'final balance:\s*\K.*(?=\s+candidate balance)')
@spac3unit
spac3unit / tokens.md
Created October 21, 2021 20:36 — 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

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@spac3unit
spac3unit / telegramChannelBot.md
Created October 21, 2021 20:34 — forked from zmts/telegramChannelBot.md
Используем Telegram канал в качестве системы оповещения

Используем Telegram канал в качестве системы оповещения

  • Создаем бота через глобального бота телеграма @BotFather
  • Создаем публичный канал через обычный клиент(desktop/mobile) с публичным именем
  • Добавляем бота в администраторы канала (с правами отправлять сообщения)
  • Отправляем тестовое сообщение в канал от имени только что созданного бота
#POST: https://api.telegram.org/bot<token>/sendMessage
{
  "chat_id": "@mysuperchannel",
@spac3unit
spac3unit / aboutNodeJsArchitecture.md
Created October 21, 2021 19:55 — forked from zmts/aboutNodeJsArchitecture.md
A little bit about Node.js API Architecture

A little bit about Node.js API Architecture (Архитектура/паттерны организации кода Node.js приложений)

node.js

TL;DR

code: https://github.com/zmts/supra-api-nodejs

Предисловие

Одной из болезней Node.js комьюнити это отсутствие каких либо крупных фреймворков, действительно крупных уровня Symphony/Django/RoR/Spring. Что является причиной все ещё достаточно юного возраста данной технологии. И каждый кузнец кует как умеет ну или как в интернетах посоветовали. Собственно это моя попытка выковать некий свой подход к построению Node.js приложений.

@spac3unit
spac3unit / forVarLetClosure.md
Created October 21, 2021 19:52 — forked from zmts/forVarLetClosure.md
Javascipt. For. Var. Let. Closure. Event loop.

Javascipt. For. Var. Let. Closure. Event loop.

var

for(var i = 0; i < 5; i++) {
    setTimeout(function() {
        console.log(i);
    }, 1000);
}
@spac3unit
spac3unit / permissions.md
Created October 21, 2021 19:51 — forked from zmts/permissions.md
Управление правами/ролями в Node.js приложениях (Permissions/ACL)

Управление правами/ролями в Node.js приложениях (Permissions/ACL)

Допустим у наc есть такой CRUD и мы хотим проверять права доступа к каждому екшену.

class PostsController extends BaseController {
  static get router () {
    router.get('/', actionRunner(actions.ListAction))
    router.get('/:id', actionRunner(actions.GetByIdAction))
    router.post('/', actionRunner(actions.CreateAction))
    router.patch('/', actionRunner(actions.UpdateAction))
@spac3unit
spac3unit / start_end.md
Created October 21, 2021 19:50 — forked from zmts/start_end.md
Start/End day. Native JavaScript

Start/End day. Native JavaScript

new Date(new Date().setHours(0,0,0,0)).toISOString()
new Date(new Date().setHours(23,59,59,999)).toISOString()
@spac3unit
spac3unit / docker.md
Created October 21, 2021 19:45 — forked from zmts/docker.md
Docker, TypeScript, Node.js

Docker, TypeScript, Node.js

Preconditions:

  • TS application listening port: 7777
|-- dist
|-- src
|-- .dockerignore
|-- Dockerfile