This file contains 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
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
id="WebApp_ID" version="2.5"> | |
<context-param> | |
<param-name>contextConfigLocation</param-name> | |
<param-value>classpath:application-context.xml</param-value> | |
</context-param> |
This file contains 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
@Value("${encryption.key}") | |
String encryptionKey; | |
private Key generateKey(String salt) throws Exception { | |
MessageDigest md = MessageDigest.getInstance("SHA-1"); | |
byte[] hash = md.digest((encryptionKey + salt).getBytes("UTF-8")); | |
byte[] key = Arrays.copyOf(hash, 16); | |
return new SecretKeySpec(key, ALG); | |
} |
This file contains 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
doAnswer(new Answer<Object>() { | |
public Object answer(InvocationOnMock invocation) { | |
Object[] args = invocation.getArguments(); | |
return new Object(); | |
} | |
}).when(mock).voidMethodThatNeedsVerifying; |
This file contains 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.thehutgroup.thirdpartyplatform.service; | |
public interface SymmetricEncryption { | |
public String encrypt(String plainText, String salt); | |
public String encrypt(String plainText, int salt); | |
public String decrypt(String encryptedText, String salt); | |
public String decrypt(String encryptedText, int salt); |
This file contains 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
def generatedResources = "src/main/generated-sources" | |
task jaxb(){ | |
description 'Converts xsds to classes' | |
def jaxbTargetDir = file( generatedResources ) | |
jaxbTargetDir.deleteDir() | |
doLast { | |
jaxbTargetDir.mkdirs() |
This file contains 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
sourceSets.main.java.srcDirs += 'src/main/generated-sources' |
This file contains 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
def benchmark = { closure -> | |
start = System.currentTimeMillis() | |
closure.call() | |
now = System.currentTimeMillis() | |
now - start | |
} | |
def originalTime = benchmark { | |
productList.each { productId -> | |
def param = [productId] |
This file contains 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.thehutgroup.sherlock.domain; | |
import java.io.StringReader; | |
import org.jdom.Document; | |
import org.jdom.input.SAXBuilder; | |
import org.jdom.output.Format; | |
import org.jdom.output.XMLOutputter; | |
public class Snippet { |
This file contains 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
{ | |
"midstate" : "f216ca85dba879b20f6243997b81df0706dcee58604823e867bf6410b703f459", | |
"data" : "000000024424e630e0924f88c89d8f74b0babdcfdcb6976196de99af00000128000000008a4ca094d0b15296fce5a5ba7c1707ff261f7e171ddfffa168284bfd755262545103bf421a05a6b100000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000", | |
"hash1" : "00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000", | |
"target" : "0000000000000000000000000000000000000000000000b1a605000000000000" | |
} |
This file contains 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
{ | |
"hash" : "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048", | |
"confirmations" : 213125, | |
"size" : 215, | |
"height" : 1, | |
"version" : 1, | |
"merkleroot" : "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098", | |
"tx" : [ | |
"0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098" | |
], |
OlderNewer