Skip to content

Instantly share code, notes, and snippets.

View josephnicholas's full-sized avatar
💻
Working from home

Joseph Nicholas R. Alcantara josephnicholas

💻
Working from home
View GitHub Profile
console->info("===== schduler =====");
console->info("main thread id: {}", getThreadId());
Rx::schedulers::run_loop runloop;
Rx::subject<int> subject;
auto observable = subject.get_observable();
observable
.map([&](int v) {
console->info("thread[{}] - published value: {}", getThreadId(), v);
return v;
@josephnicholas
josephnicholas / Instrumentor.h
Created June 4, 2021 04:06 — forked from TheCherno/Instrumentor.h
Basic Instrumentation Profiler
//
// Basic instrumentation profiler by Cherno
// Usage: include this header file somewhere in your code (eg. precompiled header), and then use like:
//
// Instrumentor::Get().BeginSession("Session Name"); // Begin session
// {
// InstrumentationTimer timer("Profiled Scope Name"); // Place code like this in scopes you'd like to include in profiling
// // Code
// }
@josephnicholas
josephnicholas / Splitter.sol
Created December 27, 2019 03:16 — forked from critesjosh/Splitter.sol
A contract to split funds between addresses. Demostrates pushing vs pulling transfers
pragma solidity ^0.4.6;
contract Splitter {
mapping(address => uint) public balances;
function unsafeSplit(address address1, address address2)
public
payable
returns(bool success)