Skip to content

Instantly share code, notes, and snippets.

View MeiyappanKannappa's full-sized avatar

Karthik Meiyappan MeiyappanKannappa

View GitHub Profile
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}")
@Configuration
@EnableWebFlux
@Slf4j
public class SimpleWebSocketHandler implements WebSocketHandler {
@Bean
public SimpleUrlHandlerMapping simpleUrlHandlerMapping() {
Map<String, WebSocketHandler> urlMap = new HashMap<>();
urlMap.put("/ws", this::handle);
@Configuration
@EnableWebFlux
@Slf4j
public class SimpleWebSocketHandler implements WebSocketHandler {
@Autowired
Sinks.Many<Object> sink;
@Bean
public SimpleUrlHandlerMapping simpleUrlHandlerMapping() {
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();
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();
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") :
<!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>
// 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: [
// 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