Set the base image to Ubuntu must be first instruction - use docker search to find images
FROM ubuntu # <image>
FROM ubuntu:latest # - <image>:<tag>
FROM ubuntu:precise (LTS)
Set the maintainer info
🔹 Test Case 1: Cover goToTemplatePage with complete date | |
ts | |
Copy | |
Edit | |
it('should validate and format date when complete date is present', async () => { | |
component.isCompleteDate = () => true; | |
component.userProvidedDate = '01/01/2024'; | |
component.formatUserProvidedDate = jest.fn(); | |
await component.goToTemplatePage(); |
✅ What This Example is Doing | |
1. It's mocking window.Bootstrapper._trackAnalytics: | |
ts | |
Copy | |
Edit | |
window.Bootstrapper = { | |
// @ts-ignore eslint | |
_trackAnalytics: jest.fn() | |
}; | |
This fakes the real analytics function so Jest doesn’t explode. |
// Add this to your ModelingEventInitiateComponent | |
import { trackAnalytics } from '@app/services/common/track-analytics/analytics'; | |
export class ModelingEventInitiateComponent implements OnInit { | |
// ... your existing properties ... | |
public ngOnInit(): void { | |
// ... your existing ngOnInit code ... | |
Set the base image to Ubuntu must be first instruction - use docker search to find images
FROM ubuntu # <image>
FROM ubuntu:latest # - <image>:<tag>
FROM ubuntu:precise (LTS)
Set the maintainer info
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc
Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server
Use this link and get $10 free. Just select the $5 plan unless this a production app.
import mysql.connector | |
from mysql.connector import errorcode | |
config = { | |
'user': 'root', | |
'password': '', | |
'host': 'localhost', | |
'database': 'acme' | |
} |