Skip to content

Instantly share code, notes, and snippets.

View kissarat's full-sized avatar
🏠
Working from home

Taras Labiak kissarat

🏠
Working from home
View GitHub Profile
#!/usr/bin/env python3
import signal
import sys
def _find_getch():
try:
import termios
except ImportError:
# Non-POSIX. Return msvcrt's (Windows') getch.
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
const { promises: { stat, writeFile, unlink } } = require('fs')
const { settings } = require('./settings')
class LockError extends Error {
constructor(name, message) {
super(message || `Already locked by ${name}`)
this.name = name
}
}
def compression(input_str):
def _compression(_input_str):
i = -1
counter = 1
for char in _input_str:
i += 1
if i == 0:
continue
previous = _input_str[i - counter]
if previous == char:
@kissarat
kissarat / pip-summary.sh
Created March 24, 2021 13:59
Get summary for pip packages, use . pip-summary.sh requirements.txt
#!/usr/bin/env bash
# Get summary for pip packages
# . pip-summary.sh requirements.txt
for package in $(cat $1 | sort); do
if `pip3 install -q --no-deps $package`; then
package_name=$(echo $package | sed -e 's/==.*//g')
pip3 show $package_name \
| awk -v name=Summary 'BEGIN { FS=":" } (name == $1) { print $2 }' \
| echo "$package_name:" $(cat)
amqp==2.2.2
asn1crypto==0.24.0
attrs==17.4.0
autopep8==1.3.5
Babel==2.5.1
backcall==0.1.0
bcrypt==3.1.4
beautifulsoup4==4.6.0
billiard==3.5.0.3
bleach==2.1.3
[
{
"nid": 1,
"route": [
{
"type": "Point",
"coordinates": [
24.0184463,
49.8335922
]
const notJSONContentType = {
$and: [{
url: {
$ne: "/users/profile/orders/nearest"
},
'headers.content-type': {
$not: {
$regex: '.*application.json.*'
}
}
{
"type": "object",
"required": ["type"],
"properties": {
"_id": {
"type": "string",
"pattern": "^[0-9a-f]{24}$",
"description": "id повідомлення, ганарнтує, що при повторні спробі відправити повідомлення воно не буде збережено двічі в БД"
},
"type": {
using System;
namespace Program
{
public class Program
{
public const string Impossible = "IMPOSSIBLE";
public const string StringEquals = "EQUALS";
public const string Insert = "INSERT {0}";
public const string Replace = "REPLACE {0} {1}";