View telegram_logger.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"log" | |
"os" | |
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5" | |
"go.mongodb.org/mongo-driver/mongo" | |
"go.mongodb.org/mongo-driver/mongo/options" |
View unused.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILES=$(cat package.json | jq -r '.dependencies * .devDependencies | keys | join("\n")') | |
ARR=', ' read -r -a array <<< $FILES | |
echo Not found deps | |
echo | |
for dep in "${array[@]}" | |
do | |
grep -qr "$dep" src |
View rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Blocklist for use with Little Snitch | |
# | |
# For more information about this list, see: https://pgl.yoyo.org/adservers/ | |
# ---- | |
# last updated: Fri, 03 May 2019 16:04:09 GMT | |
# entries: 2964 | |
# format: littlesnitch (littlesnitch -- for use with Little Snitch) | |
# credits: Peter Lowe - pgl@yoyo.org - https://pgl.yoyo.org/ - https://twitter.com/pgl | |
# this URL: http://pgl.yoyo.org/adservers/serverlist.php?hostformat=littlesnitch;showintro=0 | |
# Patreon: https://patreon.com/blocklist |
View eslint-local-rules.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Should be used with "eslint-plugin-local-rules" plugin | |
*/ | |
'use strict' | |
module.exports = { | |
'no-await-in-expressions': { | |
meta: { | |
type: 'problem', |
View fuzzy_history.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fuzzy history | |
hist() { | |
local cmd | |
cmd=$(history | sed -E 's/[0-9]+\ \ //g' | sort -u | grep '^[^\ ]' | fzf --no-multi) && | |
echo "\$ $cmd" && | |
command $cmd | |
} |
View ClientRender.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ClientRender helps to avoid server-client render inconsistency. | |
* | |
* I.E. client render depends on data from LocalStorage | |
* | |
* Usage: | |
* | |
* r(ClientRender, {server: 'Rendered on server'}, 'Rendered on client') | |
*/ | |
import {Component} from 'react' |
View domain.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Tool to create domain with cert | |
# ./domain.sh test.example.com 1234 | |
# where 1234 - upstream port | |
# Input params | |
DOMAIN=$1 | |
UPSTREAM_PORT=$2 |
View log.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
/* eslint-disable no-console */ | |
/* | |
* Логгер, создается в разных контекстах | |
* Имеет внутренний стейт, так как должнен быть создан и начать | |
* работать до запуска основных модулей | |
* | |
* Доступные уровни: ALL, WARN, ERROR, SILENT | |
* |
View btc.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Various bash bitcoin tools | |
# | |
# requires dc, the unix desktop calculator (which should be included in the | |
# 'bc' package) | |
# | |
# This script requires bash version 4 or above. | |
# | |
# This script uses GNU tools. It is therefore not guaranted to work on a POSIX | |
# system. |
View cache.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Simple implementation of memory cache | |
* | |
* Is use async API in case we replace it with redis. | |
* | |
* Keys should be symbols. | |
*/ | |
const DEFAULT_TTL = 5 * 60 * 1000 | |
const CLEAN_INTERVAL = DEFAULT_TTL * 1.5 |
NewerOlder