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/bash | |
| # exclude ".qml.*" because QtCreator on change 'Transport.qml' creates additional file like 'Transport.qml.R12384' | |
| cd src/v4qml | |
| inotifywait -mre close_write --exclude '\.qml\.' --format "%w %f" . | while read dir file; do | |
| # cut './' from the path './RegionUI/...' → 'RegionUI/...' | |
| f="${dir:2}$file" | |
| echo "Changed: $f" | |
| # @TODO change 'drz' to $1 | |
| adb push "$f" "/sdcard/drz/$f" | |
| adb shell am force-stop ru.dublgis.dgismobile |
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
| /*! | |
| Бинарный поиск ближайшего значения. Если значение за пределами списка, возвращает индекс крайнего элемента. | |
| Возвращает индекс найденного элемента. | |
| x >> 1 === Math.floor(x / 2) | |
| \param type:array list | |
| \param type:number value | |
| \param type:function getVal функция, которая достает нужное значение из элемента списка list | |
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 QtQuick 2.3 | |
| // @TODO (salnikov): добавить минимальные отступы клеткам | |
| Rectangle { | |
| width: 200 | |
| height: 600 | |
| property real maxWidth: 200 | |
| property real maxWidthHalf: maxWidth / 2 |
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
| /* | |
| @param {Object} node | |
| @param {Number} spacing | |
| */ | |
| function traverse(node, spacing) { | |
| console.info('NODE ::', _spacing(spacing), node) | |
| var children = node.data; | |
| if (!children) return |
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
| alert(1) |
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
| property bool collecting: false | |
| property var bbbbb: { | |
| if (!collecting) { | |
| collecting = true; | |
| collect(branchCardBody) | |
| } | |
| } | |
| function newEvent(item, eventName) { | |
| var globalCoord = item.mapToItem(null, 0, 0); |
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
| /* | |
| What's better way to find a class match – `classes.indexOf(className)` or `for loop + return`? | |
| */ | |
| function hasClass(el, className) { | |
| var classes = el.className.split(' '); | |
| for (var i = 0; i < classes.length; i++) { | |
| if (classes[i] === className) { | |
| return true; | |
| } |
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
| /** | |
| * Takes prefixes and suffixes from first occurence of those and populate them to all other values. | |
| * Wrapper function wraps valid numbers and gets rid of NaNs. | |
| * | |
| * Example: | |
| * const wrap = valueFormatter(['$10', '20', '30']); | |
| * const label = wrap(10); // '$10' | |
| */ | |
| class ValueFormatter { | |
| prefix: string = ''; |
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
| function translateSelector(original){ | |
| let result = original.replace(simpleRe, (match, value) => { | |
| return replace(match, value); | |
| }).replace(attributeRe, (match, op, value) => { | |
| switch (op) { | |
| case '=': | |
| console.log('=', match, value) | |
| return replace(match, value); | |
| case '^=': | |
| console.log('^=', match, value) |
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 * as React from 'react'; | |
| type Store = { treasure: number }; | |
| type Presenter = { digTreasure: (store: Store, place: string) => void }; | |
| type MyCompo1Props = { store: Store, presenter: Presenter }; | |
| class MyCompo1 extends React.Component<MyCompo1Props> { | |
| render() { | |
| /* should be an error because `this` in `digTreasure` will be not as expected */ | |
| return <MyCompo2 onDig={this.digTreasure}/>; |