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 / RxFirebase.java
Last active November 23, 2015 11:05 — forked from gsoltis/RxFirebase.java
RxJava Bindings for Firebase
package com.firebase.client;
import com.firebase.client.AuthData;
import com.firebase.client.ChildEventListener;
import com.firebase.client.DataSnapshot;
import com.firebase.client.Firebase;
import com.firebase.client.FirebaseError;
import com.firebase.client.Query;
import com.firebase.client.ValueEventListener;
import com.firebase.client.core.view.Event;
@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:

@krebernisak
krebernisak / system-design-cheat-sheat.md
Created April 30, 2020 18:38
System design cheat sheet - It can be used for interviews or assessments (forked from Nikolay Ashanin)

System design cheat sheet

It can be used for interviews or assessments.

1. Understand problem and scope:

  • Recognize stakeholders and prioritize them. Create RACI matrix
  • Understand business drivers of the project
  • Recognize end-users of the project and understand how they will use that system
  • Check functional requirements
  • Define external dependencies
  • Suggest additional features
  • Remove items that interviewer considers out of scope

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 / README.md
Created January 19, 2021 19:40
Optimism OVM integration

Optimism OVM integration

The docs page, while a good resource, is currently out of date.

Solidity support

Solidity source code needs to be compiled using OVM modified solc compiler. Because of the way OVM is architectured, the Optimism team needs to work to support specific Solidity compiler versions. Currently supported are v0.5 & v0.6, while work is started on v0.7 & v0.8.

The JS compiler can be found in ethereum-optimism/solc-js repo. Branches of interest are master-0.5 & master-0.6.

@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",