Copy the default template of openssl.cnf to a writable location.
cp /etc/ssl/openssl.cnf src
Uncomment the req_extensions = v3_req
req_extensions = v3_req # The extensions to add to a certificate request
Add subjectAltName to v3_req section
| class ImagedModel(models.Model): | |
| class Meta: | |
| abstract = True | |
| def __init__(self, *args, **kwargs): | |
| super().__init__(*args, **kwargs) | |
| pre_delete.connect(self.pre_delete, self.__class__, dispatch_uid='%s_pre_delete' % str(self.__class__).lower()) | |
| def save(self, *args, **kwargs): | |
| try: |
| from django.core.exceptions import ImproperlyConfigured | |
| from django.urls import NoReverseMatch, get_resolver, get_urlconf, reverse | |
| def get_apps_urls(resolver=None, nsprefix='', urlprefix=''): | |
| result = {} | |
| if not resolver: | |
| resolver = get_resolver(get_urlconf()) | |
| for name, urlattrs in resolver.reverse_dict.items(): |
Copy the default template of openssl.cnf to a writable location.
cp /etc/ssl/openssl.cnf src
Uncomment the req_extensions = v3_req
req_extensions = v3_req # The extensions to add to a certificate request
Add subjectAltName to v3_req section
| def translate(path, mx, my): | |
| out = [] | |
| parts = path.split(' ') | |
| for part in parts: | |
| if ',' in part: | |
| nums = part.split(',') | |
| prex = nums[0][0] if nums[0][0] in ('M', 'C', 'L') else '' | |
| numx = float(nums[0][1:]) if nums[0][0] in ('M', 'C', 'L') else float(nums[0]) | |
| prey = nums[1][0] if nums[1][0] in ('M', 'C', 'L') else '' | |
| numy = float(nums[1][1:]) if nums[1][0] in ('M', 'C', 'L') else float(nums[1]) |
Run it in new postgres bin folder
pg_upgrade.exe
-b D:\database\PostgreSQL-9.5-x64\bin -- old postgres bin folder without end slash
-B D:\database\PostgreSQL-10.7-x64\bin -- new postgres bin folder without end slash
-d D:\cluster\PostgreSQL-9.5-x64 -- old postgres cluster data folder without end slash
-D D:\cluster\PostgreSQL-10.7-x64 -- new postgres cluster data folder without end slash
-U postgres| export default class CoordinatesEncoder { | |
| static SCALE = 1000000; | |
| static encode(polygons) { | |
| const result = []; | |
| const intToCodes = (number) => { | |
| const result = []; | |
| for (let i = 0; i < 4; i++) { | |
| result[i] = 255 & (number >> 8 * i); // eslint-disable-line no-bitwise |
| # Windows 10, x64 | |
| # Python 3.8.5 | |
| def sep(a=None, b=None): | |
| return {**({'a': a} if a else {}), **({'b': b} if b else {})} | |
| def comp(a=None, b=None): | |
| return {k: v for k, v in {'a': a, 'b': b}.items() if v} | |
| def simp(a=None, b=None): |
| // Expand TS type for IntelliSense | |
| type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never; |