Skip to content

Instantly share code, notes, and snippets.

View jordiup's full-sized avatar
👀
Looking for my next role!

Jordi Hermoso jordiup

👀
Looking for my next role!
View GitHub Profile
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';
@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
@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); })()
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 / 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);
{
"targets": [
{
"id": "1a3a6e75-fc32-4f36-8d7c-9fe2f7c0a2a1",
"targetGroupId": "group-1",
"targetGroupFrom": {
"publisher": "common-fate",
"name": "aws",
"version": "v1.0.0",
"kind": "string"
@jordiup
jordiup / CustomAvatar.tsx
Created May 27, 2023 02:49
# Nativebase Avatar with Coloured Text (Chakra UI Equivalent)
import React from 'react';
import ColorHash from 'color-hash';
import { Circle, ICircleProps, Image, Text } from 'native-base';
type Props = {
firstName: string;
lastName?: string;
name?: string;
size?: string;
src?: string;
{
"activities": [
{
"actor": {
"email": "[email protected]",
"familyName": "Wilkes",
"givenName": "Josh",
"id": "usr_2SPP3b2dtynEPF9RMJESySftFJu"
},
"allowed": true,
@jordiup
jordiup / getLastModifiedGitDate.ts
Last active October 25, 2023 04:53
useful for fetching a last modified value from a blog post
function getLastModifiedGitDate(filePath: string): Date {
filePath = 'README.md';
const query = `
{
repository(owner: "jordiup", name: "sharehouse") {
ref(qualifiedName: "refs/heads/main") {
target {
... on Commit {
history(first: 1, path: "${filePath}") {
edges {
@jordiup
jordiup / use-multiple-gh-accounts-in-desktop.md
Last active October 24, 2024 19:56 — forked from TheGardenMan/use-multiple-gh-accounts-in-desktop.md
How to use multiple GitHub accounts in GitHub Desktop

How to use multiple GitHub accounts in GitHub Desktop

Background

Let's say you have two users and repos likejordiup/repo1 and not_jordiup/repo2.

You want to push and pull from them using different accounts.

Solution