Skip to content

Instantly share code, notes, and snippets.

View krebernisak's full-sized avatar
🎯
Focusing

Kristijan Rebernisak krebernisak

🎯
Focusing
View GitHub Profile
@krebernisak
krebernisak / es_scrollable
Created January 11, 2018 18:21
ES Scrollable API exercise
// es connection
class Client {
Call create(Query q);
}
// immutable call object created for specific client an query
class Call {
Result execute();
ScrollableCall toScrollable(long ttl); // this call makes a network request to get the first scrollable token

Keybase proof

I hereby claim:

  • I am krebernisak on github.
  • I am krebernisak (https://keybase.io/krebernisak) on keybase.
  • I have a public key ASDRGM-oIfTk6c3fZu7r8r3yiQjEcnItSd4ebc5M1_43Ego

To claim this, I am signing this object:

System design interview structured approach

Step 1 — Understand the Goals

Make sure you understand the basic requirements and ask clarification questions. Start with the most basic assumptions:

  • What is the goal of the system?
  • Who are the users of the system? What do they need it for? How are they going to use it?
  • What are the inputs and outputs of the system?
@krebernisak
krebernisak / math_operations.js
Last active June 1, 2020 18:55
A function that accepts as an argument a string of addition/subtraction operations.
// Write a function that accepts as an argument a string of addition/subtraction operations.
// The function should return the result of the operations as an integer
// ex: calculate("1 - 2 + 3") => 2
// will not see: "1 - -2"
/**
* Solution:
* 1. Build a stack using Reverse Polish (Post-fix) notation
* 2. Build a stack machine that reads and executes Reverse Polish (Post-fix) notation
*
@krebernisak
krebernisak / substrate-chainlink.state_getMetadata.json
Created June 3, 2020 17:56
Substrate Metadata response for a chain with a Chainlink pallet
pragma solidity ^0.6.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.2.0/contracts/token/ERC20/IERC20.sol";
contract LinkTokenOnMatic {
IERC20 public token;
@krebernisak
krebernisak / AccessControlledAggregator.json
Created July 23, 2021 13:01
Optimistic Etherscan contract verification issue (OVM solc 0.6.12)
{
"schemaVersion": "2.0.0",
"contractName": "AccessControlledAggregator",
"compilerOutput": {
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "implementation",
@krebernisak
krebernisak / ArbitrumCrossDomain.sol
Created August 31, 2021 12:04
Testing L1 initiated L2 ETH withdrawal
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;
import "./ArbSys.sol";
import "./IInbox.sol";
/// @title ArbitrumCrossDomain test contract
contract ArbitrumCrossDomain {
/// @dev Precompiled contract that exists in every Arbitrum chain at address(100). Exposes a variety of system-level functionality.
@krebernisak
krebernisak / CrossDomainForwarder.sol
Last active September 18, 2021 10:46
Proposal for L2 xDomain Forwarder (with and escape hatch for upgrades)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../ConfirmedOwner.v2.sol";
import "./interfaces/ForwarderInterface.sol";
import "./vendor/openzeppelin-solidity/v4.3.1/contracts/utils/Address.sol";
/**
* @title CrossDomainForwarder - L1 xDomain account representation
* @notice L2 Contract which receives messages from a specific L1 address and transparently forwards them to the destination.
@krebernisak
krebernisak / devnet.feature.txt
Last active April 2, 2022 12:34
Solana devnet feature set
Feature | Status | Description
E3PHP7w8kB7np3CTQ1qQ2tW3KCtjRSXBQgW9vM2mWv2Y | active since slot 5414912 | secp256k1 program
E5JiFDQCwyC6QfT9REFyMpfK2mHcmv1GUDySU1Ue7TYv | active since slot 5414912 | spl-token multisig fix
GaBtBJvmS4Arjj5W1NmFcyvPjsHN38UGYDq2MDwbs9Qu | active since slot 5414912 | deprecate unused rewards sysvar
4kpdyrcj5jS47CZb2oJGfVxjYbsMm2Kx97gFyZrxxwXz | active since slot 18144000 | no overflow rent distribution
4RWNif6C2WCNiKVW7otP4G7dkmkHGyKQWRpuZ1pxKU5m | active since slot 19008000 | pico inflation
GE7fRxmW46K6EmCD9AMZSbnaJ2e3LfqCZzdHi9hmYAgi | active since slot 25056000 | filter stake_delegation_accounts #14062
BzBBveUDymEYoYzcMWNQCx3cd4jQs7puaVFHLtsbB6fm | active since slot 34560000 | community vote allowing Certus One to enable full inflation
BL99GYhdjjcv6ys22C9wPgn2aTVERDbPHHo4NbS3hgp7 | active since slot 37152000 | spl-token self-transfer fix
3ccR6QpxGYsAbWyfevEtBNGfWV4xBffxRj2tD6A9i39F | active since slot 4147200