Skip to content

Instantly share code, notes, and snippets.

View barorion's full-sized avatar

Gilad Bar Orion barorion

View GitHub Profile
Kotlin K2 FIR Example. Related Post: https://handstandsam.com/2024/05/30/kotlin-k2-fir-quickstart-guide/
@barorion
barorion / GitHub Flavored Asciidoc (GFA).adoc
Created June 27, 2018 07:39 — forked from dcode/GitHub Flavored Asciidoc (GFA).adoc
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

@barorion
barorion / Price-Time Matching Engine.c
Created November 5, 2017 06:53 — forked from Jud/Price-Time Matching Engine.c
Price-Time Matching Engine
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@barorion
barorion / FinancialReportMockBeanIIT.java
Created May 7, 2017 04:29
Spring integration tests: tests
package springit;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@barorion
barorion / Application.java
Created May 7, 2017 04:18
Spring integration tests: code
package springit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
@SpringBootApplication
public class Application {
public static void main(String[] args) throws Exception {
@barorion
barorion / IdService.java
Last active May 3, 2017 04:48
spring bean test
package spring;
public interface IdService {
String generateId();
}
@barorion
barorion / PasswordStrengthValidator.java
Last active April 25, 2017 12:44
PasswordStrengthValidator
interface PasswordStrengthValidator {
// should throw IllegalArgumentException for password that does not conform to the following rules:
// 1. length is 8-12
// 2. includes at least one numeric char
// 3. includes at least one special char
// 4. includes at least one alphabetic char
void validatePasswordStrength(Password password);
@barorion
barorion / pom.xml
Created April 25, 2017 07:06
testing pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>testing.presentation</groupId>
<artifactId>testing-presentation</artifactId>
<version>1.0-SNAPSHOT</version>
@barorion
barorion / EvenNiyaru.java
Created April 24, 2017 06:04
gists for testing course
public class EvenNiyaru {
public Result play(Hand myHand, Hand herHand) {
if (myHand == herHand) {
return Result.TIE;
}
switch (myHand) {
case PAPER:
@barorion
barorion / SchemaValidationBean
Last active December 19, 2015 21:08
Invoking Hibernate's schema validaton using a dedicated Spring bean
package com.ravello.management.server.data;
import javax.inject.Inject;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaValidator;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;