Skip to content

Instantly share code, notes, and snippets.

View Kurukshetran's full-sized avatar

Kurukshetran Kurukshetran

View GitHub Profile
@Kurukshetran
Kurukshetran / check-null-empty.xsl
Created January 4, 2022 13:15 — forked from ijy/check-null-empty.xsl
XSLT: Check if a string is null or empty.
<!--
CHECK IF A STRING IS NULL OR EMPTY
-->
<!-- Example XML -->
<group>
<item>
<id>item 1</id>
<CategoryName>blue</CategoryName>
</item>
@Kurukshetran
Kurukshetran / verify.go
Created December 29, 2021 14:09 — forked from jedy/verify.go
use publib key to verify in golang
package main
import (
"crypto"
"crypto/rsa"
"crypto/sha1"
"crypto/x509"
"encoding/base64"
"fmt"
)
@Kurukshetran
Kurukshetran / rsa_ecb_pkcs1.go
Created December 29, 2021 08:24 — forked from hothero/rsa_ecb_pkcs1.go
RSA/ECB/PKCS1Padding imnplementation by Golang (can work with JAVA, C#, etc.)
package main
import (
"bytes"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/base64"
"encoding/pem"
"errors"
@Kurukshetran
Kurukshetran / aes_cbc_pkcs5.go
Created December 29, 2021 08:24 — forked from hothero/aes_cbc_pkcs5.go
AES/CBC/PKCS5Padding implementation by Golang (can work with JAVA, C#, etc.)
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/base64"
"fmt"
)
@Kurukshetran
Kurukshetran / test_site.go
Created December 29, 2021 08:24 — forked from parserpro/test_site.go
gin example
package main
import (
"net/http"
"regexp"
"strconv"
"time"
"github.com/davecgh/go-spew/spew"
@Kurukshetran
Kurukshetran / ASimpleSOAPClient.java
Created September 22, 2021 13:07 — forked from kdelfour/ASimpleSOAPClient.java
A simple SOAP Client class to send request body to a SOAP Server. Useful when you want to test a SOAP server and you don't want to generate all SOAP client class from the WSDL.
package com.kdstudio.snippets.soap.client;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeaders;
@Kurukshetran
Kurukshetran / xmlToJson.xslt
Created July 29, 2021 20:01 — forked from inancgumus/xmlToJson.xslt
XML to JSON using XSLT
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="utf-8"/>
<xsl:template match="/*[node()]">
<xsl:text>{</xsl:text>
<xsl:apply-templates select="." mode="detect" />
<xsl:text>}</xsl:text>
</xsl:template>
@Kurukshetran
Kurukshetran / App.java
Created June 2, 2021 16:12 — forked from thomasdarimont/App.java
Example for defining a refreshable Groovy Script in Spring Boot with Java Config - at least thats the current state of affairs :)
package demo;
import java.util.concurrent.TimeUnit;
import org.springframework.aop.TargetSource;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@Kurukshetran
Kurukshetran / App.java
Created June 2, 2021 16:12 — forked from thomasdarimont/App.java
Example for refreshable Groovy Scripts via Java Config. RefreshableGroovyScript is a FactoryBean that produces Proxies backed by a RefreshableTargetSource. Changes in the groovy script are picked up after the configured time interval.
package demo;
import static java.util.concurrent.TimeUnit.*;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class App {
import java.util.*;
public class MutableJson {
public static void main(String[] args) {
MutableJson json = new MutableJson(
new HashMap<String, Object>() {{
put("store", new HashMap<String, Object>() {{
put("name", "Some Store");
put("books", Arrays.asList(