Skip to content

Instantly share code, notes, and snippets.

View borisd's full-sized avatar

Boris Dinkevich borisd

View GitHub Profile
const arr = [1,2,3,4,6];
const reduce = (arr, init, cb) => {
// TODO this!
}
// Mini test
const sum = reduce(arr, 0, (a, i) => a + i);
const mul = reduce(arr, 1, (a, i) => a * i);
@borisd
borisd / pricing.csv
Created July 22, 2019 10:03
AirBnB / Booking pricing
City AirBnB Booking
Barcelona $230-$350 $230-$300
Kiev $100-$150 $50-$150
Miami $150-$250 $200-$400
Bangkok $125-$200 $50-$250
@borisd
borisd / keybase.md
Created April 16, 2019 12:08
keybase.md

Keybase proof

I hereby claim:

  • I am borisd on github.
  • I am murkin (https://keybase.io/murkin) on keybase.
  • I have a public key ASBy3hjxlPeTlRaF85E-0ib6LkxR3Zcp7lgotywTN6tumAo

To claim this, I am signing this object:

@borisd
borisd / code.sol
Created February 4, 2018 16:42
PoWHCoin
pragma solidity ^0.4.18;
// If you wanna escape this contract REALLY FAST
// 1. open MEW/METAMASK
// 2. Put this as data: 0xb1e35242
// 3. send 150000+ gas
// That calls the getMeOutOfHere() method
// Wacky version, 0-1 tokens takes 10eth (should be avg 200% gains), 1-2 takes another 30eth (avg 100% gains), and beyond that who the fuck knows but it's 50% gains
@borisd
borisd / history.js
Created December 21, 2017 08:05
React Router 4 - Redirect middleware
import { createBrowserHistory } from 'history'
const history = createBrowserHistory({});
export default history;
@borisd
borisd / example.js
Created April 20, 2017 00:36
Simple Redux Implementation
const reducer = (state, action) => action.type == 'INC'
? Object.assign({}, state, { counter: state.counter + 1 })
: state;
const store = createStore(reducer, { counter: 1 });
const unsubscribe = store.subscribe(() => console.log('Counter: ' + store.getState().counter));
store.dispatch({ type: 'INC' })
store.dispatch({ type: 'INC' })
@borisd
borisd / app.js
Last active January 22, 2017 13:55
import React from 'react';
import { render } from 'react-dom';
import './index.css';
const Recipe = ({ recipe }) => (
<li>{ recipe }</li>
);
const Recipes = ({ recipes }) => (
<ul>
@borisd
borisd / foo.js
Last active January 22, 2017 08:18
const greet = ({ name = 'Me' }) => console.log(`Hi ${ name }`);
const repeat = (name, count = 0) => {
if (count) {
setTimeout(() => greet({ name }), 1000 * count);
repeat(`${ name }.`, count - 1);
}
};
repeat('Boris', 10);
@borisd
borisd / design.css
Created January 8, 2017 16:17
React & Redux course
@charset "UTF-8";
hr {
margin: 20px 0;
border: 0;
border-top: 1px dashed #c5c5c5;
border-bottom: 1px dashed #f7f7f7;
}
.learn a {
font-weight: normal;
@borisd
borisd / api.js
Created June 26, 2016 16:50
API middleware
const API = 'API';
const API_STARTED = 'API_STARTED';
const API_ERROR = 'API_ERROR';
const API_DONE = 'API_DONE';
const CANCEL_API = 'CANCEL_API';
const API_ROOT = 'https://s3.amazonaws.com/500tech-shared/';
const apiAction = {