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
// Made by @charlestehio: https://x.com/charlestehio | |
// Usage: https://abc.workers.dev/?query=your%20embedding%20query | |
import { Ai } from './vendor/@cloudflare/ai.js'; | |
export default { | |
async fetch(request, env) { | |
// Parse the URL to get query parameters | |
const url = new URL(request.url); | |
var query = url.searchParams.get('query'); |
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
{ | |
"basics": { | |
"name": "Rishabh Singh", | |
"label": "Programmer", | |
"image": "", | |
"email": "john@gmail.com", | |
"phone": "(912) 555-4321", | |
"url": "https://johndoe.com", | |
"summary": "A summary of John Doe…", | |
"location": { |
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 asyncio | |
from aiogram import Bot, Dispatcher, types | |
bot = Bot(token='TOKEN') | |
dp = Dispatcher(bot) | |
@dp.chat_join_request_handler() | |
async def handle_chat_join_request(chat_join_request: types.chat_join_request.ChatJoinRequest): | |
user_id = chat_join_request.from_user.id | |
channel_id = chat_join_request.chat.id |
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 matplotlib.pyplot as plt | |
import numpy as np | |
from mpl_toolkits.mplot3d import Axes3D | |
def calc_score(discount_percentage, average_rating): | |
return 1 / (1 + np.exp(-((2 * discount_percentage / 100) + (average_rating / 5) - np.maximum(0, 4 - average_rating)))) | |
discount_percentages = np.linspace(0, 50, 100) | |
average_ratings = np.linspace(0, 5, 100) |
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 parseChapters = (description) => { | |
// Extract timestamps (either 00:00:00, 0:00:00, 00:00 or 0:00) | |
const lines = description.split("\n") | |
const regex = /(\d{0,2}:?\d{1,2}:\d{2})/g | |
const chapters = [] | |
for (const line of lines) { | |
// Match the regex and check if the line contains a matched regex | |
const matches = line.match(regex) | |
if (matches) { |
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
s = "abcabcbb" | |
t = [] | |
c = 0 | |
n = 0 | |
for i in s: | |
if i in t: | |
if c > n: | |
n = c | |
c = 0 | |
t = [i] |
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
#include <stdio.h> | |
int findMin(int arr[], int n) | |
{ | |
int min = arr[0]; | |
for (int i = 1; i < n; ++i) { | |
if (arr[i] < min) { | |
min = arr[i]; | |
} | |
} |
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
<script lang="ts"> | |
import { metatags } from "@roxi/routify"; | |
import Theme from "./components/Theme.svelte"; | |
import { | |
Content, | |
ContentSwitcher, | |
DataTable, | |
Form, | |
FormGroup, | |
Header, |
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
<script lang="ts"> | |
import { onMount } from "svelte"; | |
let ref: HTMLInputElement; | |
let page: any = 0; | |
let pages: number = 1; | |
let rows: any[] = []; | |
let total: number; | |
let type: string = "title"; | |
let state: string = "onload"; |
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
<script lang="ts"> | |
import { onMount } from "svelte"; | |
let loading = true; | |
let title: string, | |
subtitle: string, | |
description: string, | |
author: string, | |
year: string, |
NewerOlder