Use react-ultimate-pagination with react-bootstrap Pagination

Publishing a quick code snippet how to use  react-bootstrap Pagination with react-ultimate-pagination.

I need a component with predefined properties that I need that will render pagination customized according to current project needs.

Let’s build some internal pagination component. This is actually what react ultimate pagination guide advice to do.

Now let’s build a component that we will use in our application

Finally all we need to do inside the app is

Enjoy your coding and share your ideas in comments

How your code should interact with elasticsearch

I wrote a few articles about elasticsearch. It’s great tool for searching. It develops very fast and has very rich API. It changed my vision to search. I tend to use only one line search that will search what  you need in all your models by any field that you want.  I think I have pretty good experience with ES. And I continue to extend my knowledge.

In this article I would like to share my vision how to organize your code responsible for search in Elasticsearch.

Continue reading

Elixir Phoenix models with images.

Today I’m going to talk about elixir and phoenix framework. It’s my first post about them and today I would like to tell you how did I solve quite common problem for web development – serving images for your domain models.


In my app – users have avatars,  companies have logos and any other model can have referring image. I need to have ability to save images for my models. I want to have ability to save them to AWS S3 and locally(in future I want to add new providers).

Continue reading

Angular2 – REST sample app, part 1

It’s time to learn angular2. Stay on trend 🙂 So I decided to play with it and I wanted to make some app that uses REST API. IMO it’s most common example. But unfortunately I didn’t find good sample apps or articles to start. It’s very likely that this article become outdated very soon. But right now I think this could be very useful, because still angular2 in beta personally I faced with a few pitfalls. Going to implement something very simple. But simple is not easy.

Continue reading

Direct upload to s3 with php AWS4 progressbar blueimp file uploader validation

Continue to talk about AWS and S3. Today I will share my experience in direct upload to s3. This could be useful when it comes to big files. You can upload file directly to S3.

  • No need to wait twice
  • progress bar works correct. If you upload through your server progress bar will show you only upload process to your server but then your users will wait until you upload file to s3

If you got to bluimp docs you will find the arcticle in the wiki but it use old algorithm and you progressbar won’t work. Also you will find out that blueimp validation won’t work as expected.

Continue reading

Upload big files to s3 by URL

Recently I needed to upload files to s3 having URL. Unfortunately I didn’t find a way how can I do that with native AWS php sdk. So I needed to provide either file or file body Upload an Object Using the AWS SDK for PHP . I didn’t want to care about temp files. So the easiest solution that came up to my head were

// @see
$body = @get_file_content($url);
Yii::app()->resourceManager->save($body, $path, $options);

That worked fine, I also could get file size and mime type having file body. Maybe not very elegant but it worked. Until…

Continue reading