Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
Create free AWS Account at https://aws.amazon.com/
I would be creating a t2.medium ubuntu machine for this demo.
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
Create free AWS Account at https://aws.amazon.com/
I would be creating a t2.medium ubuntu machine for this demo.
import { OpenAI } from 'langchain/llms/openai' | |
import { PromptTemplate } from 'langchain/prompts' | |
import { loadQARefineChain } from 'langchain/chains' | |
import { MemoryVectorStore } from 'langchain/vectorstores/memory' | |
import { OpenAIEmbeddings } from 'langchain/embeddings/openai' | |
import { | |
StructuredOutputParser, | |
OutputFixingParser, | |
} from 'langchain/output_parsers' |
import React, { useState, useEffect } from 'react'; | |
import VideoPlayer from './VideoPlayer'; // Import your VideoPlayer component | |
const Create = () => { | |
const [watchVideo, setWatchVideo] = useState(false); | |
const [startTime, setStartTime] = useState(null); | |
const [elapsedTime, setElapsedTime] = useState(0); | |
useEffect(() => { | |
let interval; // Store the interval ID |
import { useState, useEffect } from 'react'; | |
const TestStateChangeTime = ({}) => { | |
const [elapsedTime, setElapsedTime] = useState(0); | |
const [isModalOpen, setIsModalOpen] = useState(false); | |
const handleButtonClick = () => { | |
setIsModalOpen(!isModalOpen); | |
}; |
#nginx config file for Nextjs App | |
#place in /etc/nginx/sites-available/name_of_config_file | |
server { | |
listen 80; | |
server_name domainname.com; | |
gzip on; | |
gzip_proxied any; | |
gzip_types application/javascript application/x-javascript text/css text/javascript; | |
gzip_comp_level 5; |
function findNestedObject(object, keyToFind, valToFind) { | |
let foundObj; | |
JSON.stringify(object, (_, nestedValue) => { | |
if (nestedValue && nestedValue[keyToFind] === valToFind) { | |
foundObj = nestedValue; | |
} | |
return nestedValue; | |
}); | |
return foundObj; | |
} |
const debug = require('debug')('steve'); | |
debug('variable value... through debug'); | |
//console.log('variable value... through console.'); | |
let arr = [].fill(123, 0, 10000); | |
let arr2 = new arr.map(item => item * 10); // needed `new` in front of Array | |
debug('after the loop'); |
// Place your key bindings in this file to override the defaults | |
[ | |
{ "key": "cmd+1", "command": "workbench.action.openEditorAtIndex1" }, | |
{ "key": "cmd+2", "command": "workbench.action.openEditorAtIndex2" }, | |
{ "key": "cmd+3", "command": "workbench.action.openEditorAtIndex3" }, | |
{ "key": "cmd+4", "command": "workbench.action.openEditorAtIndex4" }, | |
{ "key": "cmd+5", "command": "workbench.action.openEditorAtIndex5" }, | |
{ "key": "cmd+6", "command": "workbench.action.openEditorAtIndex6" }, | |
{ "key": "cmd+7", "command": "workbench.action.openEditorAtIndex7" }, | |
{ "key": "cmd+8", "command": "workbench.action.openEditorAtIndex8" }, |