Skip to content

Instantly share code, notes, and snippets.

const NOTIFICATION_TEMPLATES: Record<NotificationTypes, NotificationTemplate> = {
[NotificationTypes.NEW_MATCH]: {
type: NotificationTypes.NEW_MATCH,
title_template: "It's a Match! 🎉",
body_template: "You and {name} liked each other",
data_template: {
type: 'match',
user_id: '{user_id}',
action: 'open_chat'
},
/**
* Superwall Service
*
* This service provides a clean interface for interacting with the Superwall Expo SDK.
* It includes user management, paywall presentation, and subscription status tracking.
*/
export const SUPERWALL_API_KEYS = {
ios: "key here",

<SYSTEM_ROLE> You are Bullwise — an editorial stock-insights engine that publishes exactly 3 U.S.-listed stock ideas each weekday before 9:00 AM ET. Your tone is educational/editorial, not advisory. Each idea is designed to reach its target or stop within 21 days, using technicals, momentum, and risk/reward. </SYSTEM_ROLE>

<DATA_SOURCE> • Use real-time prices from the web. • Primary validation: Google Finance live quotes. • Each pick must include the verified real-time price, timestamp, and the source link: https://www.google.com/finance/beta/quote/[TICKER:EXCHANGE] // Note Beta here

@Majidalee1
Majidalee1 / vapi-handler.ts
Created November 12, 2024 21:51
vapi-handler
import OpenAI from "https://deno.land/x/openai@v4.24.0/mod.ts";
async function* generateStreamingResponse(chatCompletionStream: any) {
for await (const event of chatCompletionStream) {
if (event.choices && event.choices[0].delta?.content) {
console.log(
`event.choices[0].delta?.content`,
event.choices[0].delta?.content,
);
@Majidalee1
Majidalee1 / chat-handler.ts
Created November 12, 2024 21:50
chat-handler
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
import OpenAI from "https://deno.land/x/openai@v4.24.0/mod.ts";
import { createClient } from "https://esm.sh/@supabase/supabase-js@2";
// user sends a message
// A webhook is triggered
// The webhook sends the message to OpenAI - with 4 prevous messages
// OpenAI returns a response
// The response is saved in the database
// The response is sent back to the user
@Majidalee1
Majidalee1 / chatMessages.ts
Last active October 25, 2024 21:52
chat-messages-with-supabase
import React, { useState, useCallback, useEffect, useContext } from "react";
import {
GiftedChat,
Bubble,
Avatar,
Time,
Send,
IMessage,
} from "react-native-gifted-chat";
import { View, Text, Image, Linking, StyleSheet, Platform } from "react-native";
@Majidalee1
Majidalee1 / notificatoins.ts
Last active October 18, 2024 20:29
supabase-push-notifications
import { createClient } from "jsr:@supabase/supabase-js@2";
// aleemii270@gmai.com
interface Notification {
id: string;
user_id: string;
body: string;
}
@Majidalee1
Majidalee1 / retail-payrol.sql
Created August 12, 2024 07:45
Retail App Monthly Payrol Query
SELECT
c.id AS "SessionId",
c.startTime AS "Consultation Date",
c.startTime AS "Start Time",
c.endTime AS "End Time",
au.appName AS "Platform",
IF(
(IF(c.appointmentId IS NULL, t.type, ts.type) IS NULL),
(
CASE