Skip to content

Instantly share code, notes, and snippets.

@dodikk
dodikk / PaymentsTrackingChart.html.md
Created April 13, 2023 12:23
Stacked bar chart based on ChartJs
<html style="width:97%;height:100%;">
  <head><script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.min.js"></script></head>
  <body style="width:100%;height:100%;">
    <div id="chart-container" style="width:100%;height:100%;">
  <canvas id="chart" />
</div>
    <script>var config = {"type":"bar","data":{"datasets":[{"label":"Cancelled","data":[49.0,45.0,25.0,16.0,36.0,32.0,22.0],"backgroundColor":"#F859AC","stack":"Stack 0"},{"label":"Paid","data":[17.0,22.0,33.0,23.0,4.0,35.0,20.0],"backgroundColor":"#11BFBF","stack":"Stack 0"},{"label":"Timed Out","data":[42.0,20.0,7.0,33.0,22.0,14.0,18.0],"backgroundColor":"#1C60DD","stack":"Stack 0"}],"labels":["1","2","3","4","5","6","7"]},"options":{"responsive":true,"maintainAspectRatio":false,"legend":{"position":"top"},"animation":{"animateScale":true},"scales":{"x":{"stacked":true},"y":{"stacked":true}}}};
window.onload = function() {
@dodikk
dodikk / README.md
Created December 10, 2019 15:03
MS Appcenter Crashes.TrackError() is sent even if the app has not crashed
@dodikk
dodikk / raw-tx-tutorial-btc.txt
Created April 30, 2019 08:13
raw transaction tutorial passed by me
[
{
"txid" : "70edfb7e1fd581a9b6c66bc2c964914939c75c3cf53750cfa494d93020eafd0e",
"vout" : 0
}
]
{
"2N8xphn3BkDjmEck9UEZP1mcUYyxkZuv3es" : 49
@dodikk
dodikk / DroidTweakToolbar.cs
Last active April 25, 2019 08:38
Tweak droid toolbar from code - xamarin.droid
var yellowColor = Color.ParseColor("#f6c046");
// set left icon color
Toolbar.NavigationIcon.SetTint(yellowColor);
// set text color
Toolbar.SetTitleTextColor(yellowColor);
Toolbar.SetSubtitleTextColor(yellowColor);
@dodikk
dodikk / android-crashlog -hints.md
Last active April 2, 2019 16:48
Android crashlog hints
  1. Search by app id
Process: <app id>
E AndroidRuntime: <app id>
E AndroidRuntime: android.runtime.JavaProxyThrowable:
E AndroidRuntime: FATAL EXCEPTION:
  1. --------- beginning of crash
  2. tombstone keyword
@dodikk
dodikk / AdkSplitterForTwo.sol
Created October 17, 2018 11:30
Embark gas consumption issue
pragma solidity ^0.4.23;
contract AdkSplitterForTwo
{
event LogBeginSplit();
event LogEndSplit();
event LogSamePersonRevert();
event LogTransferToFirstReceiverBegin();
#define KINDOF_CAST(arg) ((__kindof typeof(arg))(arg))
// By Scherbinin Anatoly from the cocoa chat ("Какао-чат: Cocoa, Xcode, objective C")
@dodikk
dodikk / main.cpp
Created October 3, 2018 15:15
Dynamic cast demo c++
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
@dodikk
dodikk / confirmEtherTransaction.js
Created October 2, 2018 14:42 — forked from dsemenovsky/confirmEtherTransaction.js
Confirm Ethereum transaction
function confirmEtherTransaction(txHash, confirmations = 10) {
setTimeout(async () => {
// Get current number of confirmations and compare it with sought-for value
const trxConfirmations = await getConfirmations(txHash)
console.log('Transaction with hash ' + txHash + ' has ' + trxConfirmations + ' confirmation(s)')
if (trxConfirmations >= confirmations) {
// Handle confirmation event according to your business logic