Skip to content

Instantly share code, notes, and snippets.

View PShchahelski's full-sized avatar

Pavel Shchahelski PShchahelski

View GitHub Profile
@PShchahelski
PShchahelski / TaskBusinessEventConsumer.kt
Created August 22, 2023 18:16
TaskBusinessEventConsumer
package com.training.accounting.events
import com.training.accounting.task.domain.TaskService
import com.training.accounting.task.domain.model.toTask
import com.training.accounting.transaction.domain.TransferService
import com.training.scheme.registry.business.task.v1.TaskAddedBusinessEvent
import com.training.scheme.registry.business.task.v1.TaskAddedPayload
import com.training.scheme.registry.business.task.v1.TaskCompletedBusinessEvent
import com.training.scheme.registry.business.task.v1.TaskCompletedPayload
import org.apache.avro.specific.SpecificRecord
@PShchahelski
PShchahelski / git-commit-template.md
Created March 14, 2022 20:20 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@Component
interface Component {
@Component.Factory
interface Factory {
fun create(
@BindsInstance dialogId: DialogId,
): Component
}
@PShchahelski
PShchahelski / ListAdapter.java
Created March 17, 2016 21:31 — forked from janheinrichmerker/ListAdapter.java
A RecyclerView.Adapter which can be used as a List and notifies the RecyclerView of every changes to the contained data.
package com.heinrichreimersoftware.playstorewatcher.adapters;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
@PShchahelski
PShchahelski / CheatSheet.java
Created March 17, 2016 21:30 — forked from romannurik/CheatSheet.java
Android helper class for showing cheat sheets (tooltips) for icon-only UI elements on long-press. This is already default platform behavior for icon-only action bar items and tabs. This class provides this behavior for any other such UI element.
/*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layoutfab);
//Outline
int size = getResources().getDimensionPixelSize(R.dimen.fab_size);
Outline outline = new Outline();
public class ExampleActivity extends Activity implements WatchFaceLifecycle.Listener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_layout);
WatchFaceLifecycle.attach(this, savedInstanceState, this);
}
@Override
package com.test;
public class ClassA {
public ClassA() {
System.out.println("ClassA()");
method();
}
public void method() {