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
#!/usr/bin/env python3 | |
import signal | |
import sys | |
def _find_getch(): | |
try: | |
import termios | |
except ImportError: | |
# Non-POSIX. Return msvcrt's (Windows') getch. |
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
## | |
# 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. | |
# |
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 { 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 | |
} | |
} |
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
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: |
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
#!/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) |
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
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 |
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
[ | |
{ | |
"nid": 1, | |
"route": [ | |
{ | |
"type": "Point", | |
"coordinates": [ | |
24.0184463, | |
49.8335922 | |
] |
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 notJSONContentType = { | |
$and: [{ | |
url: { | |
$ne: "/users/profile/orders/nearest" | |
}, | |
'headers.content-type': { | |
$not: { | |
$regex: '.*application.json.*' | |
} | |
} |
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
{ | |
"type": "object", | |
"required": ["type"], | |
"properties": { | |
"_id": { | |
"type": "string", | |
"pattern": "^[0-9a-f]{24}$", | |
"description": "id повідомлення, ганарнтує, що при повторні спробі відправити повідомлення воно не буде збережено двічі в БД" | |
}, | |
"type": { |
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
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}"; |