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
if (event.target.classList[0] === "points") { | |
this.toggleSortTable.points ? this.users.sort((a, b) => b.points_earned - a.points_earned) : this.users.sort((a, b) => a.points_earned - b.points_earned); | |
this.toggleSortTable.points = !this.toggleSortTable.points; | |
} else if (event.target.classList[0] === "name") { | |
if(this.toggleSortTable.name) { | |
this.users.sort(function (a, b) { | |
if (a.name < b.name) { | |
return 1; | |
} | |
if (a.name > b.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
const fn = (f, list) => { | |
if(list.length === 0) { | |
return []; | |
} | |
const [x, ...xs] = list | |
return f(x) ? [x, ...fn(f, xs)]: fn(f,xs) | |
} | |
const arrEx = [4, 2, 5, 1, 3]; |
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 { getQueue } from '../test/data'; | |
import ExecutorExt from '../test/ExecutorExt'; | |
import { IExecutor } from './Executor'; | |
import ITask from './Task'; | |
export default async function run(executor: IExecutor, queue: Iterable<ITask>, maxThreads = 0) { | |
maxThreads = Math.max(0, maxThreads); | |
/** | |
* Код надо писать сюда | |
* Тут что-то вызываем в правильном порядке executor.executeTask для тасков из очереди queue |
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
{ | |
"editor.tabSize": 2, | |
"editor.insertSpaces": true, | |
"editor.detectIndentation": false, | |
"editor.formatOnSave": true, | |
"[javascript]": { | |
"editor.formatOnSave": false | |
}, | |
"css.fileExtensions": ["css", "scss", "less"], | |
"editor.quickSuggestions": { |
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
{ | |
"editor.tabSize": 2, | |
"editor.insertSpaces": true, | |
"editor.detectIndentation": false, | |
"editor.formatOnSave": false, | |
// "css.fileExtensions": [ | |
// "css", | |
// "scss", | |
// "less" | |
// ], |
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
{ | |
"editor.tabSize": 2, | |
"editor.insertSpaces": true, | |
"editor.detectIndentation": false, | |
"editor.formatOnSave": false, | |
// "css.fileExtensions": [ | |
// "css", | |
// "scss", | |
// "less" | |
// ], |
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
(function() { | |
angular.module("BauVoiceApp").directive("customValidation", function() { | |
return { | |
require: "ngModel", | |
link: function(scope, element, attrs, modelCtrl) { | |
modelCtrl.$parsers.push(function(inputValue) { | |
const numberPattern = /\d+/g; | |
let transformedInput = inputValue.match(numberPattern)[0]; | |
if (transformedInput != inputValue) { | |
modelCtrl.$setViewValue(transformedInput); |
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
let a = angular.element($0).injector(); | |
a.get("formDirective"); |
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
function maybe(fn) | |
return function _maybe(...args) { | |
// Note that the == is deliberate. | |
if ((args.length === 0) || args.some(a => (a == null)) { | |
return undefined; | |
} | |
return fn.apply(this, args); | |
} | |
} |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
th { | |
cursor: pointer; | |
} | |