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
/** | |
* Переключатель темы Bootswatch for Twitter Bootstrap. | |
* http://jsbin.com/momonupayu/1/edit?html,js,output | |
* http://bootswatch.com/help/ | |
* | |
* Цепляется к событию change элемента select#themeswitch. | |
* Меняет link содержащий bootswatch в аттрибуте href. | |
*/ |
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
// Ext.dom.Element | |
var div = Ext.getBody().createChild({ | |
tag: "div", | |
cls: "print" | |
}); | |
var div = Ext.getBody().appendChild({ | |
tag: "div", | |
cls: "print" | |
}); | |
var svg = Ext.dom.Helper.createDom("<svg/>"); |
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
/** | |
* Модуль для добавления статических файлов из подключенных модулей (например jQuery, Bootstrap и т.п.). | |
* | |
* Пример использования: | |
* app.usePackages(["jquery", "bootstrap"]); | |
* script(src="/package/jquery/jquery.min.js") | |
* link(href="/package/bootstrap/css/bootstrap.min.css" rel="stylesheet") | |
* script(src="/package/bootstrap/js/bootstrap.min.js") | |
* |
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
async function exec(command) { | |
const from = '866', to = 'utf8'; | |
const exec = Util.promisify(ChildProcess.exec); | |
const {stdout, stderr} = await exec(command, {encoding: 'buffer'}); | |
return { | |
stdout: Encoding.convert(stdout, to, from).toString(to), | |
stderr: Encoding.convert(stderr, to, from).toString(to) | |
}; | |
}; | |
const {stdout, stderr} = await exec(`dir`); |
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
import * as Path from 'path'; | |
import * as Gulp from 'gulp'; | |
import * as GulpChanged from 'gulp-changed'; | |
import * as GulpTypeScript from 'gulp-typescript'; | |
/** | |
* Gulpfile введен в разработку пока лишь с одной целью: | |
* копировать JSON и XML файлы из src в dist. | |
*/ |
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
// TextDecoder, TextEncoder, https://github.com/inexorabletash/text-encoding | |
String2Uint8Array: function(str) { | |
return new TextEncoder().encode(str); | |
}, | |
Uint8Array2String: function(arr, encoding) { | |
return new TextDecoder(encoding || "utf-8").decode(arr); | |
} |
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
// | |
// Кусочно-квадратичная интерполяция | |
// http://aco.ifmo.ru/el_books/numerical_methods/lectures/glava3.html | |
// | |
function interpol2(x, p) { | |
var a21 = (p[2][1] - p[0][1]) / ((p[2][0] - p[0][0]) * (p[2][0] - p[1][0])); | |
var a22 = (p[1][1] - p[0][1]) / ((p[1][0] - p[0][0]) * (p[2][0] - p[1][0])); | |
var a2 = a21 - a22; | |
var a1 = (p[1][1] - p[0][1]) / (p[1][0] - p[0][0]) - a2 * (p[1][0] + p[0][0]); |
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
/** | |
* Проверка массива логических значений. | |
* Возвращает true, если в массиве присутствуют и true и false. | |
* @param {boolean[]} booleanArray | |
* @returns {boolean} | |
*/ | |
function isMixedBooleanArray(booleanArray: boolean[]): boolean { | |
let isMixed = false, firstItem = booleanArray[0]; | |
for (const item of booleanArray) { | |
if (isMixed) break; |
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
import React, {Component, ContextType, FC, Fragment, MouseEvent, ReactNode} from 'react'; | |
import {FaTrashAlt} from 'react-icons/all'; | |
import classNames from 'classnames'; | |
import TabPanelContext from '../TabPanel/TabPanelContext'; | |
import ETabType from './ETabType'; | |
import styles from './TabHeader.scss'; | |
interface IRegularProps { | |
label?: string; | |
onRemove?: (item: any) => void; |
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
import React, {forwardRef} from 'react'; | |
import {styled} from '@material-ui/styles'; | |
import {TopProperty, LeftProperty} from 'csstype'; | |
type TLength = string | 0; | |
type TDivProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>; | |
interface IFloatingDivProps { | |
x: number; | |
y: number; |
OlderNewer