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
type Promisified<T extends Function> = | |
T extends (cb: (err: any, data: infer TData) => any) => void ? () => Promise<TData> : | |
T extends (arg0: infer TArg0, cb: (err: any, data: infer TData) => any) => void ? (arg0: TArg0) => Promise<TData> : | |
T extends (arg0: infer TArg0, arg1: infer TArg1, cb: (err: any, data: infer TData) => any) => void ? (arg0: TArg0, arg1: TArg1) => Promise<TData> : | |
/* etc */ | |
never; | |
function w0args(cb: (err: Error, data: string) => void) {} | |
function w1args(arg0: number, cb: (err: Error, data: string) => void) {} | |
function w2args(arg0: number, arg2: boolean, cb: (err: Error, data: string) => 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
function nextTick(callback) { | |
setTimeout(callback, 0); | |
} | |
class Promise { | |
constructor(callback) { | |
this.state = 'pending'; | |
this.onSuccess = []; | |
callback(value => { |
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 parseNumber(str) { | |
const m = str.match(/^-?\d+/); | |
if (!m) { | |
throw new SyntaxError('not a number at ' + str); | |
} | |
const number = m[0]; | |
return { | |
ast: { type: 'number', value: parseInt(number, 10) }, | |
rest: str.substr(number.length) | |
}; |
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
lol = "07123e1f482356c415f684407a3b8723e10b2cbbc0b8fcd6282c49d37c9c1abc"; | |
kek = "b794385f2d1ef7ab4d9273d1906381b44f2f6f2588a3efb96a49188331984753"; |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<meta http-equiv="Cache-Control" content="no-cache"> | |
<meta http-equiv="Content-Security-Policy" content="style-src 'self' 'nonce-foobar==';"> | |
<!-- Replace CSP with next line to make svg render correctly --> | |
<!--<meta http-equiv="Content-Security-Policy" content="style-src 'self' 'unsafe-inline';">--> |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<meta http-equiv="Cache-Control" content="no-cache"> | |
<title>Firefox foreignObject background-image canvas rendering bug</title> | |
<style> | |
td { border: 1px darkblue solid; } |
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
var cities = [ | |
'Барселона', 'Братислава', 'Вена', 'Кёльн/Бонн', | |
'Ларнака', 'Милан', 'Мюнхен' | |
]; | |
$('.airtickets-cities') | |
.filter((ix, el) => cities.every(x => el.textContent.indexOf(x) === -1)) | |
.closest('.airtickets-item') | |
.remove() |