Skip to content

Instantly share code, notes, and snippets.

@vqt123
vqt123 / markdown.json
Created September 2, 2021 03:04
markdown for opensea with link
{"name":"Cool Cat #1.json","description":"Cool Cats is a collection of 9,999 randomly generated and stylistically curated NFTs that exist on the Ethereum Blockchain. Cool Cat holders can participate in exclusive events such as NFT claims, raffles, community giveaways, and more. Remember, all cats are cool — but some are cooler than others. Visit [www.coolcatsnft.com](https://www.coolcatsnft.com/) to learn more","image":"https://gateway.pinata.cloud/ipfs/QmWPemRxWKDCsazequKzi2adeL9kxHz3factnqiP3EEYx7"}
@vqt123
vqt123 / docker_install.md
Last active September 23, 2021 04:14
install docker and docker compose on amazon linux

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@vqt123
vqt123 / cardschema.js
Created August 25, 2021 03:50
mongodb mongoose indexing explaining queries full text search
const cardSetSchema = mongoose.Schema({
title: String,
description: String,
tags: [String],
data: String,
userId: String,
});
cardSetSchema.index({data: "text", title: "text", description: "text", tags: "text"});
cardSetSchema.index({userId: 1});
@vqt123
vqt123 / gist:fb6b9e5721daf55f088dc5375911ec8a
Last active September 1, 2021 20:15
installing vite svelte and tailwindcss
npm init vite@latest
choose svelte
(dont run npm install until after tailwind)
npx svelte-add tailwindcss
npm instal
edit svelte.config.js and remove the duplicate default export at the top
try to keep everything in 1 docker-compose and 1 dockerfile
put all environment variables next to the service in the docker-compose file
ref:
https://blog.cloud66.com/10-tips-for-docker-compose-hosting-in-production/
@vqt123
vqt123 / rollup.config.js
Created August 17, 2021 05:38
Getting environment variables to work with svelte
import replace from '@rollup/plugin-replace';
export default {
replace({
"process.env.SERVER_URI" : `"${process.env.SERVER_URI}"`,
}),
};
@vqt123
vqt123 / Dockerfile
Last active August 17, 2021 04:04
#svelte #docker #livereload #rollup
FROM node:14.17.3
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
ENV PORT 5000
ENV HOST 0.0.0.0 <--- important
EXPOSE $PORT
EXPOSE 35729 <--- important
@vqt123
vqt123 / .dockerignore
Created August 15, 2021 17:55
Docker invalid ELF header
# be sure to make sure your node_modules folder isn't being copied over using .dockerignore
node_modules
Dockerfile
.dockerignore
.git
.gitignore
req.http