Skip to content

Instantly share code, notes, and snippets.

View 0-CV.md

Roman Pominov

I'm a full-stack JavaScript developer looking for a part time remote job.

I have been doing web development since 2009. Mostly worked in frontend, have a lot of experience with the React ecosystem. I have less experience in backend, mostly NodeJS, but enjoy it even more than frontend now.

Email: rpominov@gmail.com

Education

View covid-contact-tracing.md

How a contact tracing app could work while keeping everyone's data anonymous, only infected people would need to share their data if they choose to:

  • A peer-to-peer network.
  • Each client holds N connections to some other clients.
  • When a client changes the location by a significant distance, it sends its coordinates + time + ID to ONE of their current connected clients.
  • The IDs used just once and generated from a seed. Each client knows its seed but keeps it secret.
  • After the location is sent, the client kills the connection to the receiver client. And connects to a new one.
  • When a client receives a location data, it sends it to one of its current connected clients.
  • Each message gets retransmitted some N number of times.
  • Some clients act as "servers" by recording all data they see and make it public somehow so that regular apps are lightweight.
@rpominov
rpominov / compound-components.md
Last active Sep 19, 2018
Compound Components
View compound-components.md

My relationship with Compound Components

What are these?

Compound Component is a pattern in React when a component doesn't work by itself and needs other specific components to be its children or parents in order to operate.

Here is an introduction video https://www.youtube.com/watch?v=hEGg-3pIHlE

How do I feel about it?

@rpominov
rpominov / 1_new_fantasy-land.md
Last active Nov 5, 2016
Example of use of the new approach for fantasy-land
View 1_new_fantasy-land.md

This is an example of use of the new approach for fantasy-land proposed in fantasyland/fantasy-land#199

Read this commnet to understand what "Spec compatible Type Representative" and "spec compatible value" means.

View Task.js
type Result<L,R> =
| {T: 'Right', value: R}
| {T: 'Left', value: L}
| {T: 'Thrown', error: any}
| {T: 'Cancel'}
type Cancel = () => void
type RunHandler<L,R> =
| (result: Result<L,R>) => void
@rpominov
rpominov / Type.js
Last active May 15, 2016
An idea of Algebraic data types helper in JS
View Type.js
const Maybe = Type({Just: ['value'], Nothing: []}, {
map(fn, maybe) {
return Maybe.case({
Just: ({value}) => Maybe.Just(fn(value)),
// Should x => x be the default handler in case() so we could omit Nothing here?
Nothing: m => m,
})
}
View fl2.md

Setoid

  1. S.equals(a, a) = true (reflexivity)
  2. S.equals(a, b) = S.equals(b, a) (symmetry)
  3. If S.equals(a, b) and S.equals(b, c), then S.equals(a, c) (transitivity)

Semigroup

  1. S.concat(S.concat(a, b), c) is equivalent to S.concat(a, S.concat(b, c)) (associativity)
View React-subscribe-component.js
function loadSomeStuff(id) {
// We return basic-stream https://github.com/rpominov/basic-streams
return _sink => {
let sink = _sink
const onSuccess = data => sink({type: 'success', data})
const onError = error => sink({type: 'error', error})
stuffLoadingService.load(id).done(onSuccess, onError)
return () => {
// We can't unsubscribe from a Promise, so we simply make sink() a noop
sink = () => {}
View streams.js
/* @flow */
type Sink<T> = (payload: T) => void
type Disposer = () => void
type Stream<T> = (s: Sink<T>) => Disposer
type F<A, B> = (x: A) => B
type LiftedF<A, B> = (s: Stream<A>) => Stream<B>
/* Lifts function `A => B` to a funcion that operates
View router-concept.md
// trnsitionRequests -> BrowserAPI -> [ resolveRoute -> loadData -> render -> restoreScroll ]

// poor man's strem.flatMapLatest()
router.pipe((payload, next) => {
  next(1)
  next(2)
  return () => {
    // cleanup
 }