Skip to content

Instantly share code, notes, and snippets.

View vatson's full-sized avatar

Vadim Tiukov vatson

View GitHub Profile
@vatson
vatson / opentok.js
Last active February 10, 2022 17:29
alert(111);
/**
* @license OpenTok.js 2.21.2 36aba9d71
*
* Copyright (c) 2010-2021 TokBox, Inc.
* Subject to the applicable Software Development Kit (SDK) License Agreement:
* https://tokbox.com/support/sdk_license
*
* Date: Wed, 17 Nov 2021 17:51:38 GMT
*/
import Vue from 'vue';
import { ExtendedVue } from 'vue/types/vue';
export function cachedProp<T extends string>(
origin: string,
cached: T,
): ExtendedVue<
Vue,
Record<string, unknown>,
Record<string, unknown>,
new VuetifyLoaderPlugin({
match (tag) {
switch (tag) {
case 'v-data-table':
return ['VDataTable', 'import VDataTable from "@/components/Common/DataTable"']
case 'v-tooltip':
return ['VTooltip', "import VTooltip from '@/components/Common/Tooltip'"]
}
}
})
import VSelect from 'vuetify/lib/components/VSelect/VSelect'
export const Select = VSelect.extend({
props: {
openOnEnter: { type: Boolean, default: true },
},
methods: {
onEnterDown() {
if (this.openOnEnter === true) {
this.constructor.superOptions.methods.onEnterDown.call(this)
@vatson
vatson / exmpl.html
Last active October 15, 2019 08:39
<!-- UserForm.vue -->
<user-form>
<field-1 />
<field-2 />
<field-3 />
</user-form>
<!-- DialogUser.vue -->
<common-dialog>
<template scope="form">
@vatson
vatson / babel.config.js
Created July 30, 2019 20:28
With Polyfills
module.exports = {
presets: [
['@vue/app', { useBuiltIns: 'entry' }],
[
'@babel/preset-env',
{
targets: {
ie: '10',
browsers: 'last 2 versions',
},
let myRandomNumber
before(async() => {
myRandomNumber = await new Promise((res, rej) => {
setTimeout(_ => res(Math.random()), 1500)
})
describe('shame on mocha', () => {
it(`my rand is ${myRandomNumber}`)
})
@vatson
vatson / decorated.js
Last active November 6, 2018 15:29
vue: decorators vs plain
import Vue from 'vue';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
declare const _default: FunctionalComponentOptions<Record<string, any>, string[] | {
[x: string]: PropOptions<any> | (() => any) | (new (...args: any[]) => any) | ((() => any) | (new (...args: any[]) => any))[];
}>;
@vatson
vatson / rouding-loop.js
Created January 17, 2018 13:33
Check the speed the rounding inside loop and in loop's condition
const Benchmark = require('benchmark')
const suite = new Benchmark.Suite()
suite
.add('With rounding inside loop', () => {
let i = 0
let step = 0.5
while(i < 1000) {
i += Math.round(step)
}