This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl | |
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg | |
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list | |
sudo apt update | |
sudo apt install caddy | |
# Create a Caddyfile for reverse proxy | |
sudo tee /etc/caddy/Caddyfile > /dev/null <<EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from rich.logging import RichHandler | |
logging.basicConfig( | |
level=logging.DEBUG, | |
format="%(message)s", | |
datefmt="[%X]", | |
handlers=[RichHandler(rich_tracebacks=True, omit_repeated_times=False)], | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extract the URLs from the sitemap on the current page | |
const urls = Array.from(document.getElementsByTagName("url")).map(url => url.getElementsByTagName("loc")[0].textContent.trim()); | |
// Function to convert an array to a CSV string | |
function arrayToCSV(arr) { | |
return arr.map(row => row.join(",")).join("\n"); | |
} | |
// Convert the URLs to a CSV string and log it to the console | |
const csv = arrayToCSV([["URL"], ...urls.map(url => [url])]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
sudo apt-get update -y | |
# Basic packages | |
sudo apt-get install -y \ | |
git \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Record from 'neo4j-driver/types/record'; | |
export const buildNode = (n: any) => { | |
let node: Node = { | |
id: `node-${n.identity.toString()}`, | |
labels: n.labels[0], | |
}; | |
if (n.properties) { | |
for (let [key, value] of Object.entries(n.properties)) { | |
node[key] = value instanceof Neo4j.types.Integer ? value.toInt() : value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Neo4jContext, Neo4jProvider, useDatabases } from 'use-neo4j'; | |
const ExecuteQuery = ({ | |
driver, | |
nextStep | |
}) => { | |
return ( | |
<Neo4jProvider driver={driver}> | |
<CypherQuery | |
nextStep={nextStep} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createDriver } from 'use-neo4j'; | |
const DEFAULT_DB_SETTINGS = { | |
neo4jHost: 'localhost', | |
neo4jPort: '7687', | |
neo4jUsername: '', | |
neo4jPassword: '', | |
}; | |
const ConnectDatabase = ({ driver, setDriver, nextStep }) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [driver, setDriver] = useState(); | |
return ( | |
<ProgressStepper currentStep={currentStep}> | |
{currentStep === 1 && ( | |
<ConnectDatabase | |
driver={driver} | |
setDriver={setDriver} | |
nextStep={nextStep} | |
/> |