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 clone url | |
| git fetch | |
| git branch | |
| git pull | |
| git status | |
| CRLF to LF | |
| git config core.autocrlf 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
| import pyautogui | |
| import time | |
| while True: | |
| try: | |
| pyautogui.moveTo(20, 20, duration=1) | |
| time.sleep(1) | |
| pyautogui.moveTo(1000, 20, duration=1) | |
| time.sleep(1) |
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.9' | |
| services: | |
| mongo: | |
| container_name: myapp-mongo | |
| image: mongo | |
| restart: always | |
| ports: | |
| - "27017:27017" |
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
| go mod init github.com/rahul-yr/auth-service | |
| go mod tidy | |
| go install | |
| go run . | |
| go clean -modcache | |
| go get package-url | |
| go test | |
| go test -v | |
| go test ./... |
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
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "time" | |
| ) | |
| type CustomMiddlewares func(http.HandlerFunc) http.HandlerFunc |
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
| package main | |
| import ( | |
| "log" | |
| "sync" | |
| "time" | |
| ) | |
| // This is struct for mocking the connection. | |
| type SQLConnection struct { |
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
| package main | |
| import ( | |
| "log" | |
| "sync" | |
| "time" | |
| ) | |
| // This is struct for mocking the connection. | |
| type SQLConnection struct { |
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
| web : app-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
| from fastapi import FastAPI | |
| from url_shortener import router | |
| # Create the app | |
| app = FastAPI() | |
| @app.get("/") | |
| def read_root(): | |
| return {"Hello": "World"} |
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
| from pydantic import BaseModel | |
| # Define the model for the URL | |
| class CreateUrlShortener(BaseModel): | |
| url: str | |
| # Config for pydantic to validate the data in the request body | |
| class Config: | |
| orm_mode = True | |
| # Define the model for the URL Response |
OlderNewer