Skip to content

Instantly share code, notes, and snippets.

@dodikk
dodikk / watchTokenTransfers.js
Created October 2, 2018 14:42 — forked from dsemenovsky/watchTokenTransfers.js
Token transfers watcher
function watchTokenTransfers() {
// Instantiate web3 with WebSocketProvider
const web3 = new Web3(new Web3.providers.WebsocketProvider('wss://rinkeby.infura.io/ws'))
// Instantiate token contract object with JSON ABI and address
const tokenContract = new web3.eth.Contract(
TOKEN_ABI, process.env.TOKEN_CONTRACT_ADDRESS,
(error, result) => { if (error) console.log(error) }
)
@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 / BoyarStyle.cpp
Last active March 31, 2023 00:02
Russian C++
// Боярский языг.cpp : Defines the entry point for the console application.
//
#define и and
#define и_мало_равно and_eq
#define основа asm
#define само auto
#define и_мало bitand
#define или_мало bitor
@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();
@dodikk
dodikk / CastUsageExample.mm
Last active October 4, 2018 08:37
Objective-C++ cast templates
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segueId isEqualToString:@"seagueAppointmentListToMap"])
{
HLJAppointment* appointment = objc_kind_of_cast<HLJAppointment>(sender);
HLJAppointmentMapController *controller = objc_member_of_cast<HLJAppointmentMapController>(destinationController);
// property injection
controller.model = appointment;
}