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 matchPercentage = (strA, strB) => { | |
| let result = 0; | |
| for (let i = strA.length; (i -= 1);) { | |
| if (typeof strB[i] == 'undefined' || strA[i] == strB[i]) { | |
| // | |
| } else if (strA[i].toLowerCase() == strB[i].toLowerCase()) { | |
| result += 1; | |
| } else { | |
| result += 4; | |
| } |
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
| export const checkDbLock = async () => { | |
| const { confDb } = require('./config'); | |
| try { | |
| await confDb.$queryRaw`BEGIN EXCLUSIVE;`; | |
| await confDb.$queryRaw`COMMIT;`; | |
| return false; | |
| } catch (error) { | |
| return true; | |
| } | |
| }; |
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" /> | |
| <link rel="icon" type="image/svg+xml" href="/favicon.ico" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>NoMercyPlayer API</title> | |
| <script src="./dist/app.js?v=kw4n5l2n45" defer></script> |
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
| humanTime (time: string | number) { | |
| time = parseInt(time as string, 10); | |
| let days: any = parseInt(`${(time / (3600 * 24))}`, 10); | |
| let hours: any = this.pad(parseInt(`${(time % 86400) / 3600}`, 10), 2); | |
| let minutes: any = parseInt(`${(time % 3600) / 60}`, 10); | |
| let seconds: any = parseInt(`${time % 60}`, 10); | |
| if (`${minutes}`.length === 1) { | |
| minutes = `0${minutes}`; |
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 digitCharacters = [ | |
| '0', | |
| '1', | |
| '2', | |
| '3', | |
| '4', | |
| '5', | |
| '6', | |
| '7', | |
| '8', |
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
| // image | |
| .trickle-div { | |
| transition: all; | |
| transition-delay: var(--delay1); | |
| transition-duration: 300ms; | |
| } | |
| // itemcontainer | |
| @for $i from 1 to 100 { | |
| .trickle > *:nth-child(#{$i}) { |
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
| /* eslint-disable no-undef */ | |
| /* eslint-disable @typescript-eslint/no-var-requires */ | |
| const { readFileSync } = require('fs'); | |
| const { Client } = require('node-scp'); | |
| const { join } = require('path'); | |
| const env = require('dotenv'); | |
| env.config(); |
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
| export const greenToRed = [ | |
| { | |
| pct: 0, | |
| color: { | |
| r: 0, | |
| g: 0x40, | |
| b: 0, | |
| }, | |
| }, | |
| { |
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
| // ./redux/content/actions.js | |
| import { store } from '..'; | |
| import content from './content'; | |
| export const setLoading = (payload) => store.dispatch(content.actions.setContentLoading(payload)); | |
| export const setError = (payload) => store.dispatch(content.actions.setContentError(payload)); | |
| export const setInfo = (payload) => store.dispatch(content.actions.setInfo(payload)); |
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
| import react, {useEffect, useState} from 'react'; | |
| function Looper() { | |
| const [number, setNumber] = useState(0); | |
| useEffect(() => { | |
| let newNumber = 0; | |
| const interval = setInterval(() => { |