๐ฏ
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
| use std::fs::File; | |
| use std::io; | |
| use std::io::Read; | |
| fn beginner() -> Result<String, io::Error> { | |
| let f = File::open("hello.txt"); | |
| let mut f = match f { | |
| Ok(file) => file, | |
| Err(e) => return Err(e), |
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
| export FZF_DEFAULT_OPTS="--ansi --preview-window 'right:60%' --preview 'bat --color=always --style=header,grid --line-range :300 {}'" |
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
| try: | |
| assert requests.get("googlgg.com").status_code == 200 | |
| assert requests.get("abcx.com").status_code == 200 | |
| except AssertionError: | |
| print("?!") |
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
| deleteCharHandler = (index) => { | |
| const text = this.state.content.split(''); | |
| text.splice(index, 1); | |
| const updatedText = text.join(''); | |
| this.setState({content: updatedText}); | |
| } |
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
| ## reference | |
| ## https://stackoverflow.com/questions/13162771/django-how-to-see-sql-query-when-running-tests | |
| from django.db import connection, reset_queries | |
| from django.test import override_settings, TransactionTestCase | |
| class TransactionTests(TransactionTestCase): | |
| @override_settings(DEBUG=True) | |
| def test_sql(self): |
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
| version: "3" | |
| networks: | |
| monitoring: | |
| app-backend: | |
| services: | |
| cadvisor: | |
| image: google/cadvisor:${CADVISOR_VERSION:-v0.26.1} | |
| networks: |
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
| ECR=$(docker exec -it guide-aws sh -c 'aws ecr get-login --no-include-email --region ap-northeast-2') | |
| echo "creating login temp file" | |
| _ECR=$(echo ${ECR} | tr -d '\r') | |
| echo ${_ECR} > ecr.out | |
| echo 'login into ecr' | |
| $(cat ecr.out) | |
| echo "removing temp file" | |
| rm ecr.out |
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 stack deploy --compose-file ./docker-stack.yml prom-stack | |
| version: "3" | |
| services: | |
| prometheus: | |
| image: prom/prometheus:latest | |
| networks: | |
| - monitoring | |
| ports: | |
| - 9001:9090 |
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
| global: | |
| scrape_interval: 30s | |
| evaluation_interval: 30s | |
| external_labels: | |
| monitor: "prometheus-swarm" | |
| rule_files: | |
| scrape_configs: | |
| - job_name: 'prometheus' |
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
| apk update && apk upgrade && \ | |
| apk add --no-cache bash git openssh |