This file contains hidden or 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
[ | |
{ | |
"pk": "2727789085090382414", | |
"id": "2727789085090382414_4400476624", | |
"code": "CXbDbhvAAJO", | |
"taken_at": "2021-12-13T12:17:00+00:00", | |
"taken_at_ts": 1639397820, | |
"media_type": 8, | |
"product_type": "carousel_container", | |
"thumbnail_url": null, |
This file contains hidden or 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
class InstagramIdCodec: | |
ENCODING_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" | |
@staticmethod | |
def encode(num, alphabet=ENCODING_CHARS): | |
"""Covert a numeric value to a shortcode.""" | |
num = int(num) | |
if num == 0: | |
return alphabet[0] | |
arr = [] |
This file contains hidden or 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
import sys | |
def main(text): | |
n, s, result = '', '', [] | |
for i in text: | |
if i.isdigit(): | |
n += i | |
else: | |
if n: |
This file contains hidden or 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
[[1, 2, 3, 4, 5], | |
[16, 17, 18, 19, 6], | |
[15, 24, 25, 20, 7], | |
[14, 23, 22, 21, 8], | |
[13, 12, 11, 10, 9]] |
This file contains hidden or 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 _make_shift_statistic(self): | |
"""Make result and persent statistic by shift. | |
""" | |
result = self._give_by_shift() | |
result.pop('rock_mass', None) | |
return self.statistic( | |
result, | |
'Повахтовый выход, %', | |
'Повахтовая добыча м\u00B3' | |
) |
This file contains hidden or 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 | |
for db in `psql -qtc 'SELECT datname from pg_database' | grep -v template`; | |
do pg_dump -Fc $db | gzip -9 > $db.sql.gz; | |
done |
This file contains hidden or 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
brew install qemu | |
cd ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux | |
mv Docker.qcow2 Docker.qcow2.orig | |
qemu-img convert -O qcow2 Docker.qcow2.orig Docker.qcow2 |
This file contains hidden or 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
class Dad: | |
def print_shit(self, shit): | |
print(shit) | |
class Son(Dad): | |
def some_function(self): | |
def mini_function(word): |
This file contains hidden or 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
class Grandpa: | |
def print_some_shit(self, item): | |
print(item) | |
class Dad(Grandpa): | |
def __init__(self): | |
super().__init__() | |
self.shit = 'hello' | |
class Child(Dad): |
This file contains hidden or 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
docker run -ti --privileged --rm ubuntu bash | |
apt update && apt install -y docker.io | |
service docker start | |
docker ps |
NewerOlder