This file contains hidden or 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 | |
# Function to install nvm | |
install_nvm() { | |
echo "Installing NVM..." | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash | |
# Source nvm script to make nvm command available in the current session | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" |
This file contains hidden or 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
version: '3' | |
services: | |
opensearch_container: | |
container_name: opensearch_container | |
image: opensearchproject/opensearch:latest | |
ports: | |
- "9200:9200" | |
- "9300:9300" | |
environment: | |
cluster.name: opensearch_cluster # Name of the cluster |
This file contains hidden or 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 | |
# Create the file | |
nano ask.sh | |
# Paste the contents of the file | |
# Give permissions to the shell script | |
chmod +x ask.sh |
This file contains hidden or 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
app.post('/google-bulk-create', async (req, res) => { | |
try { | |
// No file uploaded | |
if(!req.files) { | |
res.send({ | |
status: false, | |
message: 'No file uploaded' | |
}); |
This file contains hidden or 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 mysql = require("mysql"); | |
const dotenv = require("dotenv"); | |
dotenv.config(); | |
// Create a connection to the database | |
const connection = mysql.createConnection({ | |
host: process.env.DB_HOST, | |
user: process.env.DB_USER, | |
password: process.env.DB_PASSWORD, | |
database: process.env.DB_NAME, |
This file contains hidden or 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 resolvers = { | |
Query: { | |
findAllCustomers: async (_, args, context) => | |
await context.models.customerModel.queries.findAllCustomers(), | |
}, | |
Mutation: { | |
addCustomer: async (_, args, context) => | |
await context.models.customerModel.mutations.addCustomer( | |
JSON.parse(JSON.stringify(args.newCustomer)) | |
), |
This file contains hidden or 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 { gql } = require("apollo-server-express"); | |
const typeDefs = gql` | |
type Customer { | |
id: ID | |
email: String | |
name: String | |
active: Boolean | |
} | |
type Query { |
This file contains hidden or 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 { gql } = require("apollo-server-express"); | |
const typeDefs = gql` | |
type Customer { | |
id: ID | |
email: String | |
name: String | |
active: Boolean | |
} | |
type Query { |
This file contains hidden or 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 { gql } = require("apollo-server-express"); | |
const typeDefs = gql` | |
type Customer { | |
id: ID | |
email: String | |
name: String | |
active: Boolean | |
} | |
`; |
This file contains hidden or 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
sudo apt-get update | |
sudo apt-get install -y apt-transport-https ca-certificates | |
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list | |
sudo apt-get update | |
sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual | |
sudo apt-get install -y docker-engine | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo groupadd docker |
NewerOlder