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 { Button } from "components/ui/button"; | |
import { useState } from "react"; | |
import { z } from "zod"; | |
const FormSchema = z.object({ | |
name: z.string().min(1, "Name is required"), | |
email: z.string().email().min(1, "Email is required"), | |
}); | |
type FormState = { |
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 pages = [] | |
const batchSize = 2000; | |
let currentIndex = 0; | |
while (currentIndex < totalUsers) { | |
pages.push({ fromIndex: currentIndex, toIndex: currentIndex + batchSize }); | |
currentIndex += batchSize; | |
} | |
await PromisePool.for(pages) | |
.withConcurrency(10) | |
.process(async (page) => { |
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 sendNotifications = functions | |
.runWith({ | |
timeoutSeconds: 540, | |
memory: '1GB', | |
}) | |
.https.onRequest(async (req, res): Promise<void> => { | |
const { fromIndex, toIndex } = req.body; | |
const usersDataResponse = await db.users.orderBy('userIndex').startAt(fromIndex).endAt(toIndex).get(); | |
const userToSendNotifications = usersDataResponse.docs.filter(onlyUserAtTimezone) |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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 taskMachine = Machine({ | |
id: 'toggle', | |
initial: 'todo', | |
context: { | |
deleted: false, | |
}, | |
states: { | |
todo: { |
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 function getVideoSourceByBrowser(sources) { | |
const isTaiwan = | |
getCookiesItem('foxplus_default_locale') && | |
getCookiesItem('foxplus_default_locale').country === 'tw' | |
if (isChrome() || isFirefox()) { | |
const isTaiwanSource = [ | |
'SCM Clean Mandarin Dash WM', | |
'Clean Mandarin Dash WM', | |
'Burnt-In Mandarin Dash WM' |
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
container_commands: | |
01-nginx: | |
command: /opt/elasticbeanstalk/hooks/configdeploy/enact/35_nginx.sh | |
files: | |
"/home/ec2-user/nginx.conf": | |
mode: "000644" | |
owner: root | |
group: root | |
content : | |
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
/** | |
* Custom underlines | |
*/ | |
body { | |
font: 250%/1.6 Baskerville, Palatino, serif; | |
text-align: center; | |
} | |
a { |
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
<Tab defaultActiveIndex={1}> | |
<div> | |
<h2>header title</h2> | |
<TabHeader> | |
<TabHeaderItem> | |
<button>Header 1</button> | |
</TabHeaderItem> | |
<TabHeaderItem> | |
<button>Header 2</button> | |
</TabHeaderItem> |
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
<Tab | |
defaultActiveIndex={1} | |
> | |
<TabHeader> | |
<TabHeaderItem disable> | |
header 1 | |
icon | |
</TabHeaderItem> | |
<TabHeaderItem> | |
header 2 |
NewerOlder