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
public boolean login(String userId, String password) { | |
try { | |
val content = soapMessageLoader.load("soap/login_message.xml", usernameOfCredential, passwordOfCredential, userId, password); | |
log.info("Login content: {}", content); | |
val soapConnectionFactory = SOAPConnectionFactory.newInstance(); | |
val endpoint = new URL(loginUrl); | |
val connection = soapConnectionFactory.createConnection(); | |
val factory = MessageFactory.newInstance(); | |
val message = factory.createMessage(new MimeHeaders(), new ByteArrayInputStream(content.getBytes())); | |
val response = connection.call(message, endpoint); |
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 get_version() { | |
if (env.TAG_NAME?.trim()) { | |
return "$TAG_NAME" | |
} | |
def baseVersion = sh(script: "mvn help:evaluate -Dexpression=project.version | grep -e '^[^\\[]'", returnStdout: true).trim() | |
if (env.BRANCH_NAME == 'master') { | |
return "$baseVersion-rc.$BUILD_NUMBER" | |
} else { | |
return "$baseVersion-alpha.$GERRIT_CHANGE_NUMBER-SNAPSHOT" | |
} |
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
url=$(git config --get remote.origin.url) | |
in_array=(${url//:/ }) | |
open https://github.com/${in_array[1]} |
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
.pdfViewer { | |
display: flex; | |
justify-content: center; | |
flex-direction: row; | |
} | |
.react-pdf__Document { | |
position: relative; | |
&:hover { |
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
npm i @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react pre-commit prettier -D |
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
import axios from "axios" | |
const BASE_API = 'http://localhost:9090/actuator' | |
async function scheduleJob(jobId) { | |
try { | |
await axios.put(`${BASE_API}/jobs/${jobId}/schedule`) | |
} catch(e) { | |
console.error(`failed to schedule job ${jobId} due to ${e.message}`) | |
} |
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
@BenchmarkMode(Mode.AverageTime) | |
@Warmup(iterations = 3, time = 1) | |
@Measurement(iterations = 5, time = 5) | |
@Threads(4) | |
@Fork(1) | |
@State(value = Scope.Benchmark) | |
@OutputTimeUnit(TimeUnit.NANOSECONDS) | |
public class KK { | |
private final XmlMapper xmlMapper; |
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
%filter to require all projects to have correct commit message | |
submit_filter(In, Out) :- | |
%unpack the submit rule into a list of code reviews | |
In =.. [submit | Ls], | |
%add commit message validator | |
require_commit_message_check(Ls, R), | |
%pack the list back up and return it | |
Out =.. [submit | R]. | |
require_commit_message_check(S1, S2) :- |
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
/** | |
* Created by atom on 6/13/2019. | |
*/ | |
public class DefaultSslFactory { | |
private DefaultSslFactory() {} | |
public static SslContextFactory getSslContextFactory() { | |
SslContextFactory sslContextFactory = new SslContextFactory(); |
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
-- sql server | |
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'TheSchema' AND TABLE_NAME = 'TheTable' | |
-- postgresql | |
SELECT EXISTS ( | |
SELECT 1 | |
FROM information_schema.tables | |
WHERE table_schema = 'schema_name' | |
AND table_name = 'table_name' | |
); | |
-- oracle |
NewerOlder