pnpm init
pnpm add <pkg>
pnpm install
pnpm link
pnpm list
pnpm store prune
pnpx <command>
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 { Firestore } = require('@google-cloud/firestore'); | |
// Create a new client | |
const firestore = new Firestore({ projectId: id, keyFilename: pathToServiceAccountJsonKey }); | |
async function quickstart() { | |
// Obtain a document reference. | |
const document = firestore.doc('posts/intro-to-firestore'); |
To create an stand-alone executable from a NodeJS project the process is as follows:
-
Install
pkg
usingnpm i -g pkg
-
If the project does not have dynamic requires use
pkg entryPoint.js
-
If the project has dynamic imports add the following code to your
package.json
"pkg": {
Start an existing instance
gcloud compute instances start <instance name>
Start an SSH session
gcloud compute ssh [user@]<instance 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
rm -rf .expo && rm -rf node_modules && yarn add [email protected] && yarn && yarn start |
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
machine="machine-name" | |
echo "Starting gcloud VM" | |
OUTPUT="$(gcloud compute instances start "${machine}" --format="json")" | |
ip="$(echo "$OUTPUT" | grep natIP | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}")" | |
echo "----------" | |
echo "VM Name: ${machine}" | |
echo "VM External IP: ${ip}" | |
echo "----------" |
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
# Generate a new key | |
ssh-keygen -t rsa -f ~/.ssh/sometest -C someTest | |
# Go to ~/.ssh and copy the contents of your .pub file | |
# Then enter the contents in the metadata section of gcloud | |
# Connect using the key created above | |
ssh -i sometest someTest@ip | |
# Then you can login without specifying the key |
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
# To run this script execute: | |
# curl -L https://gist.githubusercontent.com/agmm/80c58ca8114abd5d16259488a601fd4f/raw/1a016ca9e6e9281a57a931c6209ba41dc7ea27d7/debian-install-node.sh -o setup && sudo bash setup | |
echo -e "\n\nRemember to run with sudo" | |
# Exit if one of the commands fails | |
set -e | |
set -o pipefail | |
# Install Git |
To remove any confusion, here’s a simple rule to get it right every time:
"If applied, this commit will your subject line here"
- If applied, this commit will refactor subsystem X for readability
- If applied, this commit will update getting started documentation
- If applied, this commit will remove deprecated methods
- If applied, this commit will release version 1.0.0
- If applied, this commit will merge pull request #123 from user/branch
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
git checkout master | |
git merge --squash branch_to_merge_without_history |