Skip to content

Instantly share code, notes, and snippets.

@dodikk
dodikk / raw-tx-tutorial-btc.txt
Created Apr 30, 2019
raw transaction tutorial passed by me
View raw-tx-tutorial-btc.txt
[
{
"txid" : "70edfb7e1fd581a9b6c66bc2c964914939c75c3cf53750cfa494d93020eafd0e",
"vout" : 0
}
]
{
"2N8xphn3BkDjmEck9UEZP1mcUYyxkZuv3es" : 49
@dodikk
dodikk / DroidTweakToolbar.cs
Last active Apr 25, 2019
Tweak droid toolbar from code - xamarin.droid
View DroidTweakToolbar.cs
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 Apr 2, 2019
Android crashlog hints
View android-crashlog -hints.md
  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 Oct 17, 2018
Embark gas consumption issue
View AdkSplitterForTwo.sol
pragma solidity ^0.4.23;
contract AdkSplitterForTwo
{
event LogBeginSplit();
event LogEndSplit();
event LogSamePersonRevert();
event LogTransferToFirstReceiverBegin();
View objc_kind_of_compile_time_macro.h
#define KINDOF_CAST(arg) ((__kindof typeof(arg))(arg))
// By Scherbinin Anatoly from the cocoa chat ("Какао-чат: Cocoa, Xcode, objective C")
@dodikk
dodikk / main.cpp
Created Oct 3, 2018
Dynamic cast demo c++
View main.cpp
/******************************************************************************
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>
View confirmEtherTransaction.js
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
View watchTokenTransfers.js
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) }
)