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
| # create a file and name it Dockerfile | |
| FROM node:lts #baseimage | |
| WORKDIR /app #The WORKDIR instruction sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile. | |
| COPY . /app #The COPY instruction copies new files or directories from <src> and adds them to the filesystem of the container at the path <dest>. | |
| RUN yarn global add gatsby-cli #The RUN instruction will execute any commands in a new layer on top of the current image and commit the results. The resulting committed image will be used for the next step in the Dockerfile. | |
| RUN yarn install |
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
| # Only images that are not used for containers can be deleted no matter is the container is running or not. | |
| docker rmi [image_id] |
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
| docker images |
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
| docker run [image] |
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
| # Source: https://www.youtube.com/watch?v=vEdDGa9mKsY | |
| sudo apt update # update list of available packages | |
| sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libreadline-dev libssl-dev libffi-dev libsqlite3-dev wget libbz2-dev # install required dependencies to compile Python | |
| wget https://www.python.org/ftp/python/3.9.14/Python-3.9.14.tgz # Download python version | |
| sudo tar -xf Python-3.9.14.tgz #decompress file | |
| cd Python-3.9.14 | |
| sudo ./configure --enable-optimizations #Enable optimizations | |
| sudo make altinstall #Build and install Python |
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
| docker stop $(docker ps -a -q) |
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
| // React.ChangeEvent<HTMLInputElement> | |
| // Source https://stackoverflow.com/a/49820103/3599272 | |
| handleChange(e: React.ChangeEvent<HTMLInputElement>) { | |
| // No longer need to cast to any - hooray for react! | |
| this.setState({temperature: e.target.value}); | |
| } |
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
| // Source: https://stackoverflow.com/a/45092365/3599272 | |
| onClick={(event: React.MouseEvent<HTMLElement>) => { |
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 show {hash} | |
| git show a2c25061 | |
| # Source: https://stackoverflow.com/a/14167343/3599272 |
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 branch my-branch-name | |
| git checkout -b my-branch-name # create the branch and make chekcout on it |