Skip to content

Instantly share code, notes, and snippets.

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

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 September 19, 2018 12:36
Compound Components

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 / foo.ejs
Created August 6, 2014 19:56
An example of how to export functions from template to template in ejs
<%
catchExports.foo = function(buf, text) {
%><h1><%= text %></h1><%
}
catchExports.bar = function(buf, text) {
%><p><%= text %></p><%
}
@rpominov
rpominov / 1_new_fantasy-land.md
Last active November 5, 2016 10:46
Example of use of the new approach for fantasy-land

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.

@rpominov
rpominov / promises.md
Last active June 11, 2016 10:06
Promises how I would do them

Promises how I would do them

1. No over polymorphic .then

Four methods instead: .map(a -> b), .mapError(a -> b), .flatMap(a -> Promise), .flatMapError(a -> Promise).

Why?

  • more predictable code
  • easier to understand what is going on
@rpominov
rpominov / Task.js
Created May 22, 2016 13:06
Task concept
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 18:56
An idea of Algebraic data types helper in 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,
})
}
@rpominov
rpominov / router-concept.md
Last active May 4, 2016 22:34
Router concept
// trnsitionRequests -> BrowserAPI -> [ resolveRoute -> loadData -> render -> restoreScroll ]

// poor man's strem.flatMapLatest()
router.pipe((payload, next) => {
  next(1)
  next(2)
  return () => {
    // cleanup
 }
@rpominov
rpominov / fl2.md
Last active March 24, 2016 14:29

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)