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
| // you can do that using the locator method of the page object that is set as argument of the test function argument | |
| import { test, expect } from '@playwright/test'; | |
| test('basic test', async ({ page }) => { | |
| await page.goto('https://playwright.dev/'); | |
| const inputName = page.locator("#name") // Select element by id | |
| await expect(inputName).toBeVisible() | |
| }); |
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 remote -v | |
| # origin https://github.com/user/repo.git (fetch) | |
| # origin https://github.com/user/repo.git (push) |
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
| # using pngquant package | |
| https://github.com/kornelski/pngquant |
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 revert creates a new commit that undoes the changes from a specific commit. It doesn't remove commits from history or revert "until" a point. | |
| # How git revert works: | |
| # Creates a new commit that reverses the changes | |
| # Doesn't delete or remove commits from history | |
| # Works on specific commits, not ranges | |
| # Important: Order matters | |
| # Revert in reverse chronological order (newest first) to avoid conflicts: |
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
| java --version |
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
| // maps.Equal(map1, map2) bool | |
| myMap2 := map[string]string{ | |
| "name": "Alice", | |
| "country": "Wonderland", | |
| } | |
| fmt.Println("Second map:", myMap2) | |
| myMap3 := map[string]string{ | |
| "name": "Alice", | |
| "country": "Wonderland", |
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
| // syntax: mapLiteral := map[keyType]valueType{ key1: value1, key2: value2, } | |
| myMap2 := map[string]string{ | |
| "name": "Alice", | |
| "country": "Wonderland", | |
| } | |
| fmt.Println("Second map:", myMap2) |
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
| myMap := make(map[string]int) | |
| myMap["key1"] = 15 | |
| myMap["key2"] = 100 | |
| myMap["key3"] = 7 | |
| myMap["key4"] = 23 | |
| value, exists := myMap["key1"] | |
| fmt.Println("Value for key1:", value, "Exists:", exists) //Value for key1: 15 Exists: true | |
| valueOfKey10, existsKey10 := myMap["key10"] | |
| fmt.Println("Value for key10:", valueOfKey10, "Exists:", existsKey10) // Value for key10: 0 Exists: false |
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
| myMap := make(map[string]int) | |
| myMap["key1"] = 15 | |
| myMap["key2"] = 100 | |
| myMap["key3"] = 7 | |
| myMap["key4"] = 23 | |
| // clear syntax: clear(mapVariable) | |
| clear(myMap) | |
| fmt.Println("Map after clearing:", myMap) |
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
| // delete syntax: delete(mapVariable, key) | |
| myMap := make(map[string]int) | |
| myMap["key1"] = 9 | |
| delete(myMap, "key1") |