This takes advantage of deployment hooks on Vercel. This simply removes the deploy file if it exists. Otherwise, it creates it. Then pushes it to the repository.
Add to your package.json
{
// Bn -> Float multiplication works like this: 150e6 * (0.5 * 100) / 100 | |
// Also does some coercions for readability | |
const multiplyBnToFloat = (a: string, b: string) => { | |
return (BigInt(a) * BigInt(Number(b) * 100)) / BigInt(100) | |
} | |
// 75000000 | |
multiplyBnToFloat('150000000', '0.5000000000') |
{ | |
"React Component": { | |
"prefix": "0rc", | |
"body": [ | |
"import React from 'react';", | |
"", | |
"interface ${TM_FILENAME_BASE}Props {", | |
" name: string;", | |
"}", | |
"", |
; This configuration file is a sample of the default server settings. | |
; Changes to this file will NOT be reflected on the server. | |
; To change the server settings, modify Pal/Saved/Config/LinuxServer/PalWorldSettings.ini. | |
[/Script/Pal.PalGameWorldSettings] | |
OptionSettings=(Difficulty=None,DayTimeSpeedRate=1.000000,NightTimeSpeedRate=0.500000,ExpRate=3.000000,PalCaptureRate=1.500000,PalSpawnNumRate=1.500000,PalDamageRateAttack=1.000000,PalDamageRateDefense=1.000000,PlayerDamageRateAttack=1.000000,PlayerDamageRateDefense=1.000000,PlayerStomachDecreaceRate=1.000000,PlayerStaminaDecreaceRate=0.750000,PlayerAutoHPRegeneRate=2.000000,PlayerAutoHpRegeneRateInSleep=1.000000,PalStomachDecreaceRate=1.000000,PalStaminaDecreaceRate=0.750000,PalAutoHPRegeneRate=2.000000,PalAutoHpRegeneRateInSleep=1.000000,BuildObjectDamageRate=1.000000,BuildObjectDeteriorationDamageRate=0.000000,CollectionDropRate=1.500000,CollectionObjectHpRate=1.000000,CollectionObjectRespawnSpeedRate=1.500000,EnemyDropItemRate=2.000000,DeathPenalty=None, |
import { delay } from '../time' | |
import { throttle } from './throttle' | |
// @TODO: In the future, let's write some tests. It's proving to be challenging | |
// because vitest has no means of flushing promises, and it causes some tests | |
// to fail (ergo, we expect callback to resolve faster, but it doesn't). | |
// | |
// Manual test for throttle function. To run: | |
// $ npm i -g ts-node && ts-node throttle.manual.ts | |
const tests = { |
[ | |
[ | |
{ | |
key: 'spender', | |
value: 'cosmos1x92tnm6pfkl3gsfy0rfaez5myq5zh99aek2jmd' | |
}, | |
{ key: 'amount', value: '6250uatom' } | |
], | |
[ | |
{ |
import { Tendermint37Client } from "@cosmjs/tendermint-rpc"; | |
// @see https://github.com/cosmos/cosmjs/issues/1353 | |
// Replace await `SigningStargateClient.connectWithSigner` with this: | |
const connectWithStargateSigner: typeof SigningStargateClient['connectWithSigner'] = async (rpc, signer, options) => { | |
const client = await Tendermint37Client.connect(rpc) | |
return await SigningStargateClient.createWithSigner(client, signer, options) | |
} | |
// @see https://github.com/cosmos/cosmjs/issues/1353 |
<script src="https://cdn.tailwindcss.com"></script> | |
<body class="relative w-full h-screen m-0 bg-gradient-to-b from-mostlyBlackBlue to-veryDarkBlue | |
font-redHatText"> | |
</div> | |
<section class="w-full h-full flex flex-col justify-center items-center space-y-12"> | |
<div class="text-4xl text-white tracking-[14px] font-bold"> | |
WE'RE LAUNCHING SOON | |
</div> | |
<div class="flex justify-center items-center gap-[40px]"> |
import { useState, useMemo } from 'react' | |
import { intervalToDuration, isAfter, eachDayOfInterval, addMonths } from 'date-fns' | |
import { useInterval } from '@/hooks' | |
interface UseCountdownParameters { | |
target: Date | |
} | |
interface UseCountdownDuration { | |
days: string |
// @source https://github.com/srph/chunk-pattern/blob/master/index.js | |
// Slices the array into chunks based on the pattern. | |
// Useful for intentionally splitting an array into rows and columns on a specific pattern. | |
// e.g., display 4 on top, 2 on bottom. | |
// @use chunkPattern([1, 2, 3, 4, 5], [2, 3]) => [[1, 2], [3, 4, 5]] | |
// @use chunkPattern([1, 2, 3, 4, 5], [4, 1]) => [[1, 2, 3, 4], [5]] | |
const chunkPattern = <T>(array: readonly T[], pattern: number[]): Array<T[]> => { | |
const result: Array<T[]> = [[]] | |
let patternIndex: number = 0 | |
let patternCount: number = pattern[0] |