Skip to content

Instantly share code, notes, and snippets.

View Karytonn's full-sized avatar
💻
Writing code and fixing bugs…

Karytonn Karytonn

💻
Writing code and fixing bugs…
View GitHub Profile
@Karytonn
Karytonn / server.ts
Last active April 13, 2024 11:25
Notion API with Deno Deploy
import { serve } from "https://deno.land/[email protected]/http/server.ts"; // from Deno
interface Link {
id: number;
label: string;
url: string;
target: string;
}
const NOTION_DATABASE_ID = Deno.env.get("NOTION_DATABASE_ID")
@Karytonn
Karytonn / fisherYates.md
Last active April 13, 2024 11:22
Algoritimo de embaralhamento - Fisher Yates

Algoritmo de embaralhamento - Fisher Yates

Essa função fisherYates(array) recebe um array como entrada e retorna o mesmo array, mas com seus elementos misturados aleatoriamente. O algoritmo funciona percorrendo o array da direita para a esquerda, trocando cada elemento com um elemento aleatório que aparece antes dele na sequência. Isso garante que cada elemento tenha a mesma probabilidade de estar em qualquer posição do array embaralhado.

function fisherYates(code: string) {

  // Convert the code to an array of numbers
@Karytonn
Karytonn / Send transaction message by official WhatsApp API.md
Created October 31, 2024 12:25
Send transaction message by official WhatsApp API

Authorization

Bearer Toke - Bearer <TOKEN>

Request to

POST https://graph.facebook.com///messages
@Karytonn
Karytonn / EmbedCode.vue
Last active November 14, 2024 14:28
Add embed code in Nuxt 3 component
<template>
<div ref="embedContainer">
<div data-iframe-width="150" data-iframe-height="270" data-share-badge-id="d38052e4-817c-4700-9e79-1953638ea425" data-share-badge-host="https://www.credly.com"></div>
</div>
</template>
<script setup>
const embedContainer = ref(null);