Reference:
sudo fdisk -l
| SELECT table, | |
| formatReadableSize(sum(bytes)) as size, | |
| min(min_date) as min_date, | |
| max(max_date) as max_date | |
| FROM system.parts | |
| WHERE active | |
| GROUP BY table |
Reference:
sudo fdisk -l
| # utils.py | |
| import json | |
| from django.contrib.postgres.forms.jsonb import InvalidJSONInput, JSONField | |
| class ReadableJSONFormField(JSONField): | |
| def prepare_value(self, value): | |
| if isinstance(value, InvalidJSONInput): | |
| return value | |
| return json.dumps(value, ensure_ascii=False, indent=4) |
| #!/usr/bin/env bash | |
| # Фейковый npm | |
| # Нужен для кэширования папки node_modules | |
| # Кэш находится в папке ~/.cache/npm-inject/[sha1 хэш файла package.json]/node_modules | |
| # | |
| # В PATH надо добавить путь папки с фейковым npm, таким образом при выполнении команды `npm install` | |
| # bash вызовет фейковый npm c параметром `install`. | |
| # Фейк проверяет наличие папки [sha1 хэш файла package.json] в кэше. | |
| # Если она в кэше, создаем на неё симлинк node_modules |
Picking the right architecture = Picking the right battles + Managing trade-offs
| #!/usr/bin/env python | |
| """ | |
| Simple Python wrapper around lftp to mirror a remote ftp onto a local folder. | |
| New files are downloaded, deleted files are marked for removal in a TO_DELETE.sh | |
| script. | |
| """ | |
| import os | |
| import pprint | |
| import re |
Python syntax here : 2.7 - online REPL
Javascript ES6 via Babel transpilation - online REPL
import math| import sys | |
| from django.apps import apps | |
| from django.conf import settings | |
| from django.core.management.base import BaseCommand | |
| from django.db import connections | |
| from django.db.migrations.autodetector import MigrationAutodetector | |
| from django.db.migrations.executor import MigrationExecutor | |
| from django.db.migrations.state import ProjectState | |
| from django.db.utils import OperationalError |