Skip to content

Instantly share code, notes, and snippets.

View wise4rmgod's full-sized avatar
💻
Working from home

Nwokocha Wisdom Maduabuchi wise4rmgod

💻
Working from home
View GitHub Profile
apiVersion: apps/v1
kind: Deployment
metadata:
name: todo-app-deployment
spec:
replicas: 3
selector:
matchLabels:
app: todo-app
template:
@wise4rmgod
wise4rmgod / App.jsx
Last active September 8, 2023 11:57
This is the complete codebase for creating an image generator using React and OpenAI
import React, { useState } from "react";
import axios from "axios";
const OPENAI_API_KEY = "YOUR_OPENAI_API_KEY"; // Replace with your actual API key
function App() {
const [prompt, setPrompt] = useState("A cute baby sea otter");
const [generatedImages, setGeneratedImages] = useState([]);
const [isLoading, setIsLoading] = useState(false);
import {generatePrivateKeyFromMnemonic, Currency} from "@tatumio/tatum";
const generatefcn = async() => {
const privateKey = await generatePrivateKeyFromMnemonic(
Currency.MATIC,
true,
'antique easy athlete mechanic barrel awesome gravity bright tortoise unknown police mass vibrant floor column pigeon shoulder bean leisure never gas glory virus proud',
1
);
console.log(privateKey)
import {generateAddressFromXPub, Currency} from "@tatumio/tatum";
const generatefcn = async() => {
const address = await generateAddressFromXPub(
Currency.MATIC,
true,
'xpub6F7RPtojgZn3jUcu3fi1r7VTE9V1ZH24K6i9Bf5Y6ME9LNUVRAFSw5wBjfyiUZuaMiB4BDgTnvD7HeVFo8ftoF7qFRQ6MfEaorDbRRUFEk3',
1
);
console.log(address)
import { generateWallet,Currency } from '@tatumio/tatum';
const generatefcn = async() => {
const wallet = await generateWallet(Currency.MATIC,true);
console.log(wallet)
}
generatefcn()
import {generatePrivateKeyFromMnemonic, Currency} from "@tatumio/tatum";
const generatefcn = async() => {
const privateKey = await generatePrivateKeyFromMnemonic(
Currency.BTC,
true,
'goddess extra frost solar network soldier coil gather unfair hotel wealth total slow tragic mandate museum silent afraid position pyramid laugh finish priority wife',
1
);
console.log(privateKey)
const generatefcn = async() => {
const address = await generateAddressFromXPub(
Currency.BTC,
true,
'tpubDF9EGHyNtvYVaHZ3X4WETxAaHqh3BCCxAtSY2ZxYHEx3JZLuqiVC9PQ6cAXRumUiTxJZPMCfqCbrYEVzU1dBEawzgq9qTGEsVxGDCtYmbcb',
1
);
console.log(address)
}
import { generateWallet,Currency } from '@tatumio/tatum';
const generatefcn = async() => {
const wallet = await generateWallet(Currency.BTC,true);
console.log(wallet)
}
generatefcn()
npm install @tatumio/tatum
class Solution {
fun sortedSquares(nums: IntArray): IntArray {
val squared_value = nums.map { it * it }
return squared_value.toIntArray().sortedArray()
}
}