Skip to content

Instantly share code, notes, and snippets.

@jordiup
jordiup / Tabs.tsx
Created April 2, 2023 05:24
Tabs Component in React Native, complete with Typescript Typings
import React, { ReactNode, useEffect, useState } from 'react';
import { View } from 'react-native';
interface TabsProps {
tabIndex: number;
children: ReactNode[];
}
export const Tabs: React.FC<TabsProps> = ({ tabIndex, children }) => {
const [activeTab, setActiveTab] = useState(0);
import { ChatGPTAPI } from 'chatgpt';
import { NextApiRequest, NextApiResponse } from 'next';
import { notifyAdmin } from '../../../utils/twillio';
export type InputAI = {;
variableA: string;
variableB: string;
variableC: string;
};
@jordiup
jordiup / chat_gpt_export_to_html.js
Created December 5, 2022 13:06
ChatGPT Export To HTML - run this in your browser console :)
javascript:(function() { const a = document.createElement('a'); a.href = URL.createObjectURL(new Blob([document.querySelector('[class^="ThreadLayout__NodeWrapper"]').innerHTML.replace(/<img[^>]*>/g, '').replace(/<button[^>]*>.*?<\/button>/g, '').replace(/<svg[^>]*>.*?<\/svg>/g, '')], {type: 'text/html'})); a.download = 'chatGPT.html'; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(a.href); })()
@jordiup
jordiup / docker-compose.yml
Created September 25, 2022 06:36
postgres/pg-web docker compose file
version: '3'
services:
postgres:
image: postgres:12
ports:
- '5432:5432'
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
import twilio from 'twilio';
var accountSid = process.env.TWILIO_ACCOUNT_SID; // Your Account SID from www.twilio.com/console
var authToken = process.env.TWILIO_AUTH_TOKEN; // Your Auth Token from www.twilio.com/console
export const twilioClient = twilio(accountSid, authToken, {
accountSid,
});
let aiden = '+61488700798';