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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta name="viewport" content="width=device-width" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>BEFORE PROMOTE</title> | |
<style type="text/css"> | |
/* ------------------------------------- | |
GLOBAL |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta name="viewport" content="width=device-width" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>BEFORE PROMOTE</title> | |
<style type="text/css"> | |
/* ------------------------------------- | |
GLOBAL |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta name="viewport" content="width=device-width" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>BEFORE PROMOTE</title> | |
<style type="text/css"> | |
/* ------------------------------------- | |
GLOBAL |
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> | |
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script> | |
<link rel="import" href="bower_components/paper-tree/paper-tree.html" /> | |
</head> | |
<body> | |
<template id="t" is="dom-bind"> | |
<h3>GOT Tree: {{selected.data.name}}</h3> |
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
// Promise API extension to be able to resolve them sequentially. | |
Promise.serial = function (promises) { | |
return promises.reduce((promiseChain, currentPromise) => { | |
return promiseChain.then(chainResults => | |
// Using Promise.resolve() to be able to take any kind of 'promises' parameter: Promise, Function, Object, ... | |
Promise.resolve().then(currentPromise).then(currentResult => | |
[ ...chainResults, currentResult ] | |
) | |
); | |
}, Promise.resolve([])) |
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 computeStats(table, betMin = 0, betMax = 1000) { | |
let rows = Array.prototype.slice.call(table.rows); | |
let winCount = 0; | |
let total = 0; | |
rows.forEach((row) => { | |
if (row.cells.length === 9) { |
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
// Gather unread messages since the last date. | |
var unreads = models.filter { message in | |
return message.model.createdDate?.isAfterDate(date, granularity: .second) ?? false | |
} | |
// Among unread messages, drops those sent by me since they are known by the current user. | |
unreads = Array(unreads.drop(while: { message in | |
return message.model.isMe | |
})) |
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 {enigma, sha1} from 'sway-labs/ciphers'; | |
import {Injector} from 'sway-labs/strings/utils'; | |
import {OCR} from 'sway-labs/vision'; | |
/** | |
* Overcomplicated decoding function returning the answer of the challenge. | |
* @param {string} input Some encrypted string. | |
* @returns {Promise<string>} Possibly the decrypted answer to this non-sense. | |
*/ | |
async function decode(input: string): Promise<string> { |