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 java.util.*; | |
import java.util.concurrent.*; | |
import java.util.stream.*; | |
public class ApiCaller { | |
// Result wrapper to handle both success and failure cases | |
public static class ApiResult<T> { | |
private final String id; | |
private final T data; |
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
const computeWindow = document.querySelector("#compute-wrapper") | |
? window | |
: document.querySelector("#sandbox-compute-container")?.contentWindow; | |
if (!computeWindow) | |
throw new Error("Failed to find iframe window"); | |
const createBtn = computeWindow.document.querySelector(".oui-savant__Panel--Footer .oui-button.oui-button-primary"); | |
if (!createBtn || createBtn.textContent !== "Create") | |
throw new Error("Failed to find 'Create' button"); |
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 com.example.quickfix; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.stereotype.Component; | |
import org.springframework.web.bind.annotation.*; | |
import quickfix.*; | |
import quickfix.field.MsgType; | |
import quickfix.fix44.NewOrderSingle; |
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 org.example.gatewaytest; | |
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; | |
import static com.github.tomakehurst.wiremock.client.WireMock.get; | |
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; | |
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; | |
import com.github.tomakehurst.wiremock.client.WireMock; | |
import org.junit.jupiter.api.BeforeEach; | |
import org.junit.jupiter.api.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
<dependencies> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-web</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springdoc</groupId> | |
<artifactId>springdoc-openapi-ui</artifactId> | |
<version>1.7.0</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
import jakarta.servlet.http.Cookie; | |
import jakarta.servlet.http.HttpServletRequest; | |
import jakarta.servlet.http.HttpServletResponse; | |
import java.util.function.Supplier; | |
import org.springframework.security.web.csrf.CsrfToken; | |
import org.springframework.security.web.csrf.CsrfTokenRequestAttributeHandler; | |
import org.springframework.security.web.csrf.CsrfTokenRequestHandler; | |
import org.springframework.security.web.csrf.XorCsrfTokenRequestAttributeHandler; | |
import org.springframework.util.StringUtils; | |
import org.springframework.web.util.WebUtils; |
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
saveAsPDF(): void { | |
// Get the HTML content of the component | |
const content = this.contentToConvert.nativeElement; | |
// Options for html2pdf | |
const options = { filename: 'your-file-name.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2 } }; | |
// Use html2pdf to generate PDF | |
html2pdf().from(content).set(options).outputPdf(pdf => { | |
// Save the PDF |