View extract-url-from-sitemap.js
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])]); |
View startup.sh
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 \ |
View toMotifFormat.js
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; |
View ExecuteQuery.js
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} |
View ConnectDatabase.js
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 }) => { |
View neo4j-motif-connector.js
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} | |
/> |