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
export class ShadowDomBaseComponent extends HTMLElement { | |
static shadowMode = 'open'; | |
static templateURL = ''; | |
static templateCache = null; | |
constructor() { | |
super(); | |
this.isCustomTag = true; | |
const shadowMode = this.constructor.shadowMode || 'open'; | |
this.attachShadow({ mode: shadowMode }); |
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
package main | |
import ( | |
"fmt" | |
"go/parser" | |
"go/token" | |
"go/ast" | |
"os" | |
"log" | |
) |
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
// https://play.golang.org/p/THhs6i482cA | |
package jsonschema | |
import ( | |
"encoding/json" | |
"strings" | |
"io" | |
) |
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
# -*- coding: latin-1 -*- | |
# | |
# Copyright (C) AB Strakt | |
# Copyright (C) Jean-Paul Calderone | |
# See LICENSE for details. | |
""" | |
Simple SSL client, using blocking I/O | |
""" |
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
Получаем сразу три свойства: | |
1. инициализацию пустым slice по-умолчанию при создании родительской переменной | |
2. возможность добавлять элементы | |
3. возможность навешивать дополнительный функционал | |
package main | |
import ( | |
"fmt" | |
) |
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
Цитата из книги "Маленькая книга о Redis, Карл Сегуин": | |
Более сложным примером будут команды setbit и getbit. Есть замечательный пост о том, как Spool (Spool - приложение, | |
на которое ссылаются выше - прим. перев.) использует эти две команды для эффективного ответа на вопрос | |
«сколько уникальных посетителей было у нас сегодня?». | |
Для 128 миллионов пользователей ноутбук генерирует ответ менее чем за 50 мс и использует всего лишь 16 МБ памяти. | |
Книга "Маленькая книга о Redis, Карл Сегуин" | |
- https://github.com/kondratovich/the-little-redis-book/blob/master/ru/redis-ru.pdf |
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
eval $(minikube docker-env) | |
alias get-images="curl -k -s https://example.com/images | jq -r '.repositories[]'" | |
alias get-images-tags="curl -k -s https://example.com/images | jq -r '.repositories[]' | xargs -I{} curl -k -s https://example.com/get/{}/tags/list | jq -r '"\(.name): \(.tags | sort | reverse | join(", "))"' | awk 'BEGIN{FS=":"} {printf("%-35s %s\n", $1, $2)}' | |
когда нужно несколько локальный ip на макет в дополнении к первому | |
sudo ifconfig lo0 alias 127.0.0.2 up | |
sudo ifconfig lo0 alias 127.0.0.3 up | |
sudo ifconfig lo0 alias 127.0.0.4 up |
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
Github - https://github.com/mantyr | |
Golang | |
https://github.com/mantyr/conf | |
- библиотека для удобного доступа к конфигам, поддерживаются ini файлы | |
https://github.com/mantyr/images | |
- нативная библиотека для ресайза изображений, а так же для накладывания фильтров | |
https://github.com/mantyr/startstop | |
- библиотека для приостановки горутин и последующего продолжения их работы | |
https://github.com/mantyr/metrics |
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
Инкапсуляция - объединение данных и методов в одно целое - класс, объект, иерархия связей между ними | |
Полиморфизм - по сути речь о том что объекты разные, а методы схожих задач называются одинаково и это упрощает манипулирование объектами | |
Наследование - наследование свойств от другого объекта расширяя собственный объект | |
Инкапсуляция - механизм, объединяющий данные и обрабатывающий их код как единое целое. | |
- Многие преимущества ООП обусловлены одним из его фундаментальных принципов — инкапсуляцией | |
- Инкапсуляцией называется включение различных мелких элементов в более крупный объект, в результате чего программист работает непосредственно с этим объектом. | |
- Это приводит к упрощению программы, поскольку из нее исключаются второстепенные детали. | |
- В ООП php эта возможность обеспечивается классами, объектами и различными средствами выражения иерархических связей между ними. |
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
Разница между HASH и BTREE индесами в MySQL | |
Hash: | |
- представляет собой результат функции по ключу | |
- не видит растояния до ближайших элементов | |
- не может использоваться для операций диапазонов > и < | |
- сравнивание ключа целиком | |
- линейный при индексировании | |
- О(1) при вытаскивании значения |
NewerOlder