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 os, requests, textwrap | |
project_id = os.environ["CI_PROJECT_ID"] | |
mr_iid = os.environ["CI_MERGE_REQUEST_IID"] | |
api_base = os.environ.get("CI_API_V4_URL", "https://gitlab.com/api/v4") | |
gl_token = os.environ["GITLAB_TOKEN"] | |
# Azure OpenAI settings | |
aoai_endpoint = os.environ["AZURE_OPENAI_ENDPOINT"].rstrip("/") | |
aoai_deployment = os.environ["AZURE_OPENAI_DEPLOYMENT"] |
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 client'; | |
function HomePageInternal() { | |
return ( | |
<main> | |
<header className="sticky top-0 inset-x-0 flex flex-wrap md:justify-start md:flex-nowrap z-48 w-full bg-white border-b border-gray-200 text-sm py-2.5 dark:bg-neutral-800 dark:border-neutral-700"> | |
<nav className="px-4 sm:px-6 flex basis-full items-center w-full mx-auto"> | |
<div className="w-[300px] h-[50px] overflow-hidden flex"> | |
<img src="/quackulator-logo-final.png" alt="Quackulator Logo" /> | |
</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
import com.microsoft.aad.msal4j.*; | |
import java.io.*; | |
import java.nio.file.*; | |
import java.security.*; | |
import java.security.cert.CertificateFactory; | |
import java.security.cert.X509Certificate; | |
import java.util.*; | |
import java.util.concurrent.*; |
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 org.apache.hc.client5.http.classic.methods.HttpGet; | |
import org.apache.hc.client5.http.classic.CloseableHttpClient; | |
import org.apache.hc.client5.http.impl.classic.HttpClients; | |
import org.apache.hc.core5.ssl.SSLContextBuilder; | |
import org.apache.hc.core5.ssl.SSLContexts; | |
import javax.net.ssl.SSLContext; | |
import java.io.File; | |
import java.security.KeyStore; |
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.app.cucumber.stepdefs; | |
import io.cucumber.java.en.Given; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.client.RestTemplate; | |
import org.springframework.http.*; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class CommonSteps { |
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 com.opencsv.bean.CsvToBean; | |
import com.opencsv.bean.CsvToBeanBuilder; | |
import java.io.FileReader; | |
import java.io.Reader; | |
import java.util.List; | |
public class CsvReaderService { | |
public static List<Person> readCsv(String filePath) { | |
try (Reader reader = new FileReader(filePath)) { | |
CsvToBean<Person> csvToBean = new CsvToBeanBuilder<Person>(reader) |
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
$env:AZURE_STORAGE_CONNECTION_STRING = "<your_connection_string>" | |
az storage blob upload --container-name my-container --name myfile.txt --file "C:\path\to\myfile.txt" |
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
@Service | |
public class ReactiveSolrService { | |
@Autowired | |
private SolrClient solrClient; | |
public Flux<SolrDocument> queryWithFallback(String preFilter, Predicate<SolrDocument> postFilter, int batchSize) { | |
return querySolrWithPreFilter(preFilter, batchSize) | |
.onErrorResume(e -> { | |
if (isBooleanQueryLimitException(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
az network nsg rule create --resource-group <your-resource-group> --nsg-name <your-nsg-name> --name AllowHTTPHTTPS --priority 100 --direction Inbound --access Allow --protocol Tcp --source-address-prefix '*' --source-port-range '*' --destination-address-prefix '*' --destination-port-range 80 443 | |
az network nsg rule list --resource-group <your-resource-group> --query "[].{Name:name, Access:access, Port:destinationPortRange}" |
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.FilterChain; | |
import jakarta.servlet.ServletException; | |
import jakarta.servlet.http.HttpServletRequest; | |
import jakarta.servlet.http.HttpServletResponse; | |
import org.springframework.security.core.context.SecurityContextHolder; | |
import org.springframework.security.core.userdetails.User; | |
import org.springframework.security.core.userdetails.UserDetails; | |
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationToken; | |
import org.springframework.stereotype.Component; | |
import org.springframework.web.filter.OncePerRequestFilter; |
NewerOlder