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
" VIM | |
set nocompatible | |
filetype off | |
" vim-plug | |
call plug#begin() | |
" Colors {{{ | |
syntax enable |
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" |
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 |
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', |
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 | |
} |
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' |
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. |
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 |
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
const withPropsChanged = (arePropsChagned, callback) => BaseComponent => { | |
const factory = React.createFactory(BaseComponent) | |
return class Watcher extends React.Component { | |
componentWillReceiveProps(nextProps) { | |
if (arePropsChagned(this.props, nextProps)) { | |
callback(nextProps) | |
} | |
} | |
render() { | |
return factory(this.props) |
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 |
NewerOlder