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 { UTApi } from "uploadthing/server"; | |
export const utapi = new UTApi(); | |
/** | |
* Uploads an image from the given URL. | |
* | |
* @param {string} url - The URL of the image to be uploaded | |
* @return {Promise<any>} A Promise that resolves with the result of the upload process | |
*/ | |
async function uploadImageByUrl(url: string) { |
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
{- | |
TASK 3 - Find and replace binary substring | |
Binary string is represented as a cell linked list: string splitted to chunks, | |
first chunk stored to the root cell, next one to the cell in ref and so on; | |
each cell can have only one ref. | |
Write the method that find and replaces one flags in the binary string | |
with another value. Flags and values can be can be of any length, but | |
strictly up to 128 bits. The method must replace every flag it finds. | |
Flag and the value to be replaced is guaranteed to be greater than 0. | |
Lets give a simple example. We have the target flag 101110101 and the value |
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
const take = 5 | |
const transactions = new Menu<CustomContext>('transactions', { | |
onMenuOutdated: (ctx) => ctx.deleteMessage(), | |
}) | |
// Prev btn | |
.text( | |
(ctx) => { | |
const skip = ctx.msg.text.startsWith('skip-') ? Number(ctx.msg.text.split('-')[1]) : 0 | |
if (skip === 0) { | |
return '🚫' |
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 BasicTextEditor from '@/components/manageTemplates/BasicTextEditor' | |
import { useContractCategories } from '@/hooks/queries/admin' | |
import { useUpdateTemplate } from '@/hooks/queries/contracts' | |
import { useGetTemplate } from '@/hooks/queries/contracts/useGetTemplate' | |
import useBreadCrumbsTitle from '@/hooks/store/useBreadCrumbsTitle' | |
import LANG from '@/lang' | |
import AppLayout from '@/layout/Layout' | |
import { ContractTemplateData } from '@/types/contracts' | |
import { | |
categoryFormRule, |