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
# output: | |
# 100000000 -> A10000000086 | |
# 100000001 -> A10000000164 | |
# 100000002 -> A10000000242 | |
# 100000003 -> A10000000320 | |
# 100000004 -> A10000000407 | |
# 100000005 -> A10000000575 | |
def luhn_checksum(number): | |
total=0 |
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
export const luhn = (value: string) => { | |
let nCheck = 0; | |
let nDigit = 0; | |
let bEven = true; | |
const newValue = value.replace(/D/g, ''); | |
for (let n = newValue.length - 1; n >= 0; n -= 1) { | |
const cDigit = newValue.charAt(n); | |
nDigit = parseInt(cDigit, 10); |
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 topsort = function (hash) { | |
let nodes = (Object.values(hash)); | |
let output = []; | |
let seen = new Set(); | |
nodes.forEach(node => { | |
if (!seen.has(node)) { | |
dfs(node, seen, output) | |
} |
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
(async () => { | |
const getResolutions = async (m3u8url) => { | |
const options = {}; | |
try { | |
const breakdown = await fetch(m3u8url).then(res => res.text()); | |
const matches = breakdown.matchAll(/RESOLUTION=(\d+x\d+)\n(https:\/\/.*?m3u8)/g); | |
for (const match of matches) { | |
const [_, reso, url] = match; | |
options[reso] = url; |
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
:100000000C9467070C9490070C9490070C9490073D | |
:100010000C9490070C9490070C94493B0C94900717 | |
:100020000C9490070C9490070C9490070C94EF2A72 | |
:100030000C9490070C9490070C9490070C949007E4 | |
:100040000C9490070C9490070C94243B0C94F73A72 | |
:100050000C9490070C9490070C9490070C949007C4 | |
:100060000C9490070C949007040002000004000414 | |
:100070000000040704040000040404000000000061 | |
:100080000000040000000004000000000004000064 | |
:100090000202000000020407000407070400000039 |
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 { useActor, useMachine } from "@xstate/react"; | |
import React from "react"; | |
import { createMachine, ActorRefFrom, sendParent } from "xstate"; | |
export const id = "survey"; | |
export const eventStoreId = "survey"; | |
export type SurveyActorRef = ActorRefFrom<ReturnType<typeof createSurvey>>; | |
const staticConfig = { | |
id: "survey", |
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" /> | |
<title>Unity Page</title> | |
<style> | |
.red-div { | |
background-color: red; | |
width: 400px; |
OlderNewer