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
| agent = initialize_agent( | |
| toolkit.get_tools(), llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION | |
| ) | |
| agent.run(f"Comment on Issue \nAction Input:{issue_number}\n{issue_title}\n{issue_content}\n{generated_comment}") |
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
| @Configuration | |
| @EnableWebFlux | |
| @Slf4j | |
| public class SimpleWebSocketHandler implements WebSocketHandler { | |
| @Bean | |
| public SimpleUrlHandlerMapping simpleUrlHandlerMapping() { | |
| Map<String, WebSocketHandler> urlMap = new HashMap<>(); | |
| urlMap.put("/ws", this::handle); |
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
| @Configuration | |
| @EnableWebFlux | |
| @Slf4j | |
| public class SimpleWebSocketHandler implements WebSocketHandler { | |
| @Autowired | |
| Sinks.Many<Object> sink; | |
| @Bean | |
| public SimpleUrlHandlerMapping simpleUrlHandlerMapping() { |
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
| public Mono<Void> handle(WebSocketSession session) { | |
| UriComponentsBuilder builder = UriComponentsBuilder.fromUri(session.getHandshakeInfo().getUri()); | |
| Map<String,String> queryParams = builder.build().getQueryParams().toSingleValueMap(); | |
| String uniqueId = queryParams.get("email"); | |
| log.info("Websocket connected for id "+uniqueId); | |
| sink.asFlux().subscribe(new WebSocketSessionDataPublisher(uniqueId, session)); | |
| Flux<WebSocketMessage> messageFlux = session.receive().share(); |
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
| public Mono<Void> handle(WebSocketSession session) { | |
| UriComponentsBuilder builder = UriComponentsBuilder.fromUri(session.getHandshakeInfo().getUri()); | |
| Map<String,String> queryParams = builder.build().getQueryParams().toSingleValueMap(); | |
| String uniqueId = queryParams.get("email"); | |
| log.info("Websocket connected for id "+uniqueId); | |
| sink.asFlux().subscribe(new WebSocketSessionDataPublisher(uniqueId, session)); | |
| Flux<WebSocketMessage> messageFlux = session.receive().share(); |
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 diagrams import Cluster, Diagram, Edge | |
| from diagrams.gcp.network import CDN, DNS, LoadBalancing | |
| from diagrams.gcp.compute import Run | |
| from diagrams.gcp.database import SQL | |
| with (Diagram("GCP Cloud Architecture", show=True)): | |
| dns = DNS("DNS") | |
| # Create first logical grouping | |
| with Cluster("Product X") : |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>WebAuthn Registration</title> | |
| </head> | |
| <body> | |
| <h1>WebAuthn Registration</h1> | |
| <div> |
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
| // Simulate the server response with registration options | |
| const registrationOptions = { | |
| challenge: new Uint8Array(32), | |
| rp: { name: 'Example Corp', domain:'example.com' }, | |
| user: { | |
| id: new TextEncoder().encode(username), | |
| name: username, | |
| displayName: username | |
| }, | |
| pubKeyCredParams: [ |
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
| // Simulate the server response with login options | |
| const loginOptions = { | |
| challenge: new Uint8Array(32), | |
| rpId: 'example.com' | |
| }; | |
| // Use the WebAuthn API to get a credential for login | |
| const credential = await navigator.credentials.get({ publicKey: loginOptions }); | |
| // Simulate sending the credential to the server for verification |
