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
// this is how firebase generates keys | |
// https://github.com/firebase/firebase-js-sdk/blob/master/packages/database/src/core/util/NextPushId.ts | |
const decodeFirebaseKey = key => { | |
// chars firebase use for generating keys | |
const CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; | |
let timestamp = 0 | |
// we only need to decode first 8 symbols |
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 array = Array(104).fill(null).map((x,y) => y + 1) | |
let playerHandCardsNumber = 10 | |
setInterval(() => { | |
const table = document.getElementById('cards_on_table') | |
for (let i = 0; i < table.children.length; i++) { | |
const el = table.children[i] | |
const numberOnCard = +el.getAttribute('id').replace('card_', '') | |
if (array.includes(numberOnCard)) { |
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
<strong>Watch the match live <strong>today, <span id="time-holder"></span>.</strong></strong> | |
<strong>Watch the match live <strong>next month, <span id="time-holder-1"></span>.</strong></strong> | |
<strong>Watch the match live <strong>in 2 month, <span id="time-holder-2"></span>.</strong></strong> | |
<script type="text/javascript"> | |
(function() { | |
const date = new Date('8/2/2018 7:00:00 PM UTC'); | |
const language = []; |
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
// usage | |
// 1) place an html element with id="time-holder" anywhere, like <span id="time-holder"></span> | |
// 2) place script below at the end of body tag | |
// 3) pass date in format 8/2/2018 7:00:00 PM UTC | |
// 4) pass language, keep empty for en | |
// 5) set whether to replace commas | |
// 6) in case you have mulptiple dates on the same page | |
// a) simply modify id in html from time-holder to time-holder-X but keep it unique | |
// b) copy paste this script and change in the last line of this script from time-holder to time-holder-X |