{% verbatim %}
{{ vueVariable }}
{% endverbatim %}
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 function objectMergeDeep(target, source) { | |
Object.keys(source).forEach(key => { | |
const targetValue = target[key]; | |
const sourceValue = source[key]; | |
if (typeof sourceValue === 'object' && sourceValue !== null) { | |
if (typeof targetValue === 'object' && targetValue !== null) { | |
objectMergeDeep(targetValue, sourceValue); | |
} else { | |
target[key] = (Array.isArray(sourceValue)) ? [] : {}; |
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 function objectUpdateNested(obj, pathAndValue) { | |
let current = obj; | |
const value = pathAndValue.pop(); | |
for (let i = 0; i < pathAndValue.length - 1; i++) { | |
if (typeof current[pathAndValue[i]] !== 'object' || current[pathAndValue[i]] === null) { | |
current[pathAndValue[i]] = {}; | |
} | |
current = current[pathAndValue[i]]; |
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 default class LocalStorageManager { | |
constructor() { | |
this.prefix = "" | |
} | |
setPrefix(newPrefix) { | |
this.prefix = newPrefix | |
} | |
removeLocalStorage(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
/** | |
* Проскроллить к элементу (верху или низу элемента) | |
* | |
* @author https://t.me/artemsites | |
*/ | |
export default function scrollTo(params) { | |
let { selector, element, position } = params | |
let el = null | |
if (element) { |
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
/** | |
* @author https://t.me/artemsites | |
*/ | |
export default function isElementInViewportByAxisY(target) { | |
let el = (typeof target === 'string') ? document.querySelector(target) : target | |
const rect = el.getBoundingClientRect() | |
return ( | |
rect.top <= 0 | |
|| rect.bottom >= (window.innerHeight || document.documentElement.clientHeight) | |
); |
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 default function textareaAutoheight(selector) { | |
const textareaAll = document.querySelectorAll(selector) | |
textareaAll.forEach((textarea) => { | |
textarea.addEventListener("input", autoResize) | |
}) | |
function autoResize() { | |
this.style.height = this.scrollHeight + "px" | |
} |
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
/** | |
* @source https://gist.github.com/artemsites/8d260ef1682d10c70c2cf1cd256c629d | |
*/ | |
export default function getParamFromUrlSearch(paramName) { | |
if (location.search) { | |
let params = location.search.split('?')[1].split("&") | |
let param = params.find(p=>p.includes(paramName)) | |
if (param) return param.split('=')[1] | |
return false | |
} |
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
<div class="slider"> | |
<div class="item n1">1</div> | |
<div class="item n2">2</div> | |
<div class="item n3">3</div> | |
</div> |
docker https://beget.com/ru/kb/how-to/web-apps/obshhie-svedeniya-po-ustanovke-prilozhenij-virtualnoe-okruzhenie-docker
python https://beget.com/ru/kb/how-to/web-apps/python
# Docker:
ssh localhost -p222
# и мой рут пароль от акка
python2.7 -m pip install ezdxf --user --ignore-installed
NewerOlder