Skip to content

Instantly share code, notes, and snippets.

View ValeriusGC's full-sized avatar

Valery Kulikov ValeriusGC

  • Russia, Yekaterinburg
View GitHub Profile
@ValeriusGC
ValeriusGC / keybase.md
Created September 16, 2016 05:40
from keybase

Keybase proof

I hereby claim:

  • I am valeriusgc on github.
  • I am valerius (https://keybase.io/valerius) on keybase.
  • I have a public key whose fingerprint is B0DB 36B2 0B82 CF4A F87E B442 C70C 6551 B508 A515

To claim this, I am signing this object:

@ValeriusGC
ValeriusGC / UseCasesTest.java
Created February 7, 2018 06:07
Here is a sample how create 'Time Machine' with JUndo library, using time codes in UndoCommands. See more at https://github.com/ValeriusGC/jundo/tree/feat_ver2
import com.gdetotut.jundo.UndoPacket;
import com.gdetotut.jundo.UndoStack;
import org.junit.Test;
import some.TextSample;
import some.TimeMachineCommands;
import some.TimeMachineCommands.AddNewLineCmd;
import some.TimeMachineCommands.AddTextCmd;
import some.TimeMachineCommands.TimeMachineBaseCmd;
import java.util.ArrayList;
@ValeriusGC
ValeriusGC / TimeMachineCommands.java
Created February 7, 2018 07:07
How create 'Time Machine' with JUndo. See full tests and code on my Jundo-project
/**
* See all code here: https://github.com/ValeriusGC/jundo/tree/feat_ver2
*
*
*
* Don't forget implement {@link Serializable} for commands' superclass. It's mandatory.
*/
public class TimeMachineCommands implements Serializable {
/**
@ValeriusGC
ValeriusGC / Hello.kt
Last active February 7, 2018 13:20
Here is the trouble with runAsync: When application closing it stay in memory yet, as red square button 'stop' on the panel active yet.
package com.gdetotut
import javafx.application.Application
import javafx.scene.control.Button
import javafx.scene.control.Label
import javafx.scene.layout.VBox
import tornadofx.*
import java.lang.Thread.sleep
class MyApp: App(MyView::class)
@ValeriusGC
ValeriusGC / AsyncProgressApp.kt
Created February 7, 2018 13:40
ANother tornadofx sample
package com.gdetotut.sample.chapter_02
import javafx.application.Application
import javafx.geometry.Insets
import javafx.scene.paint.Color
import javafx.scene.text.FontWeight
import tornadofx.*
class AsyncProgressApp : App(AsyncProgressView::class)
@ValeriusGC
ValeriusGC / EventHandlerTest.java
Last active March 4, 2018 14:18
This show how to test Event Handlers with JUnit & Mockito.
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
class PizzaJava {
private final String name;
@ValeriusGC
ValeriusGC / EventHandlerTest.kt
Last active March 5, 2018 03:29
Kotlin: This show how to test Event Handlers with JUnit & 'Mockito-kotlin'
package vfx.kotlin
import com.nhaarman.mockito_kotlin.argumentCaptor
import com.nhaarman.mockito_kotlin.mock
import com.nhaarman.mockito_kotlin.verify
import org.junit.Assert
import org.junit.Test
data class Pizza(val name: String)
@ValeriusGC
ValeriusGC / VfxSetUserTest.java
Last active March 5, 2018 04:43
This is how one can use parameterized tests along with Mockito to provide cyclic tests of Event Handlers
package com.gdetotut.login;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.mockito.ArgumentCaptor;
import java.util.Arrays;
import java.util.Collection;
@ValeriusGC
ValeriusGC / VfxSetUserTest.kt
Created March 5, 2018 04:53
Kotlin: This is how one can use parameterized tests along with Mockito-kotlin to provide cyclic tests of Event Handlers
package com.gdetotut.login
import com.nhaarman.mockito_kotlin.argumentCaptor
import com.nhaarman.mockito_kotlin.eq
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import java.util.Arrays
@ValeriusGC
ValeriusGC / WithRx2.java
Created March 16, 2018 07:33
Sample on RxJava2. Illustrates how to connect complex processes that call each other and to traverse event messages through.
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.observers.DisposableObserver;
import io.reactivex.schedulers.Schedulers;
/**
* Замена вызовов лапши из колбеков на RxJava.
* <p>Задача - последовательное выполнение процессов.