Skip to content

Instantly share code, notes, and snippets.

View alexzaitsev's full-sized avatar
:octocat:

Alex Zaitsev alexzaitsev

:octocat:
View GitHub Profile
@alexzaitsev
alexzaitsev / CONTRIBUTOR_LICENSE_AGREEMENT.md
Created September 12, 2024 16:45
bconf.org Contributor License Agreement (Individual)

Contributor License Agreement (Individual)

Thank you for your interest in contributing to bconf.org!
Before we can accept your contributions, we kindly ask you to read and agree to the terms below by electronically signing this Contributor License Agreement ("Agreement"). This agreement ensures that we have the legal right to use your contributions in our project and to re-license the project if necessary.

  1. Definitions
  • "You" means the individual who is submitting this agreement.
  • "Contribution" means any work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to the bconf.org repository (the "Project"). "Submitted" means any form of electronic, verbal, or written communication sent to the Project, including but not limited to code submissions, patches, documentation, suggestions, or issues through source code repositories, issue trac

Successful tests

p3ngu1n@p3ngu1n bitcoin % python3 test/functional/feature_fee_estimation.py
2023-12-18T23:37:21.120000Z TestFramework (INFO): PRNG seed is: 1889367143121386098
2023-12-18T23:37:21.120000Z TestFramework (INFO): Initializing test directory /var/folders/q6/qjgkk7jn6kj_0tyhxx_dlk0m0000gp/T/bitcoin_func_test_srkyz249
2023-12-18T23:37:21.139000Z TestFramework (INFO): This test is time consuming, please be patient
2023-12-18T23:37:21.139000Z TestFramework (INFO): Splitting inputs so we can generate tx's
2023-12-18T23:37:21.751000Z TestFramework (INFO): Finished splitting
2023-12-18T23:37:22.516000Z TestFramework (INFO): Testing estimates with single transactions.
@alexzaitsev
alexzaitsev / DummyTest.kt
Created January 27, 2023 15:00
Dummy test to demonstrate Flow testing
package com.example.domain.usecase
import app.cash.turbine.test
import com.natpryce.hamkrest.assertion.assertThat
import com.natpryce.hamkrest.equalTo
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.test.runTest
import org.junit.Test
class DummyTest {
@alexzaitsev
alexzaitsev / Contract.kt
Created January 23, 2023 16:25
Song Details screen
package com.example.view.screen.song.details
data class SongDetailsViewState(
val author: Author,
val song: Song,
val loading: Boolean
)
sealed class SongDetailsSideEffect {
object ShowNetworkError : SongDetailsSideEffect()
@alexzaitsev
alexzaitsev / DefaultLinkMovementMethod.java
Last active August 27, 2024 13:33
How to display HTML using Android Compose
/**
* Set this on a textview and then you can potentially open links locally if applicable
*/
public class DefaultLinkMovementMethod extends LinkMovementMethod {
private OnLinkClickedListener mOnLinkClickedListener;
public DefaultLinkMovementMethod(OnLinkClickedListener onLinkClickedListener) {
mOnLinkClickedListener = onLinkClickedListener;
}
@alexzaitsev
alexzaitsev / BindingAdapters.kt
Last active December 6, 2018 13:29
AppBarLayout custom shadow
@JvmStatic
@BindingAdapter("isCustomShadowEnabled")
fun setAppBarDefaultShadowEnabled(appBarLayout: AppBarLayout, isCustomShadowEnabled: Boolean) {
if (isCustomShadowEnabled) {
appBarLayout.outlineProvider = null // removes the shadow below the AppBar without affecting elevation
// add the shadow
val inflater = LayoutInflater.from(appBarLayout.context)
val shadowView = inflater.inflate(R.layout.view_shadow, appBarLayout, false)
appBarLayout.addView(shadowView)
}
public static void loadAndCropImage(Context context, @DrawableRes int resourceId, final int smallerSize, ImageView imageView) {
RequestOptions transformation = RequestOptions.bitmapTransform(new Transformation<Bitmap>() {
@Override
public Resource<Bitmap> transform(Context context, Resource<Bitmap> resource, int outWidth, int outHeight) {
BitmapPool bitmapPool = Glide.get(context).getBitmapPool();
Bitmap toTransform = resource.get();
Bitmap transformed = TransformationUtils.centerCrop(bitmapPool, toTransform, smallerSize, smallerSize);
final Resource<Bitmap> result;
if (toTransform.equals(transformed)) {
100% — FF
99% — FC
98% — FA
97% — F7
96% — F5
95% — F2
94% — F0
93% — ED
92% — EB
91% — E8
@alexzaitsev
alexzaitsev / welcome.js
Last active June 6, 2017 10:36
How To Write Reusable and Testable Code with Microsoft Bot Framework
"use strict";
const builder = require("botbuilder");
const library = new builder.Library('welcome'); // welcome is a library name
const LANGUAGES = {'English': 'en', 'Русский': 'ru'};
library.dialog('/pickLocale', [
(session) => {
// Prompt the user to select their preferred locale
builder.Prompts.choice(session, "What language do you prefer?", Object.keys(LANGUAGES).join("|"));
@alexzaitsev
alexzaitsev / app.js
Last active August 1, 2017 08:50
How To Write Reusable and Testable Code with Microsoft Bot Framework
const bot = new builder.UniversalBot(connector);
bot.dialog(/, [
(session, args, next) => {
if (session.userData.languageSet) {
next();
} else {
session.beginDialog(‘welcome:/pickLocale’);
}
},
...