• Kazan

    Suddenly, I realized that I live in the biggest country in the world, and still never been anywhere further than two main cities. On the bright side, that was relatively easy to fix by traveling to Kazan. It was an exciting journey, and the city appeared to be pretty unique. Look at the pictures yourself :)

  • Using redux-form validation with redux-saga

    5ade20d8413bapexels photo 860379

    If you work with redux apps a lot, you definitely heard about the redux-form package, because working with forms without it is a pain. If not, you should know it simplifies form creation a lot. Even the complex multi-step forms with nested fields could be implemented almost effortlessly using it. The API of the package was recently revamped and it’s super fun to use now, but it’s also pretty big and you definitely can use some hints on it! :) 
    Read more
  • The road to wisdom

    Well, it’s plain and simple to express: Err and err and err again, but less and less and less.

    --- Piet Hein

  • How to avoid concurrency issues in React

    5adaf9bed8150valentino rossi alvaro bautista motogp racing 62686

    React proposes a simple declarative way to build an application’s view. It’s straightforward to write a hierarchy of stateless components or to change a state synchronously. The whole app works as an integration of two pure functions “state(event)” and “view(state)“. The behavior is testable and predictable. But you can’t make something complex without depending on an external data sources integration: side effects come into the stage. Beware, you’re approaching the Dark Zone of functional programming now :) 
    Read more
  • Server-side Google Analytics

    5a75d16261704analytics

    Usually, people integrate Google Analytics into their shops via simple pre-generated client-side javascript snippet. It’s pretty straightforward, easy to use and works most of the time correctly from the box. So why would anyone want to use a server-side integration? There could be a helluva lot of reasons for that. For example, you may want to track some events from your server-side workers — it would be ugly and unreliable to involve a browser here. Or you may want to implement a complicated funnel for your sales, mixing client-side events with your CRM events. So, is it possible? Sure, it is, and we’ll use Measurements Protocol for this. At the time, it’s a most modern way to save raw analytics data to Google Analytics from whatever environment you want. I’ll use PHP with Guzzle for code examples, but you surely can use any language and any library: there are no differences in principle at all. And let’s assume that you already have the perfectly working client-side integration.
    Read more
  • Windows workspace with WSL and Docker

    Introduction

    5a721f2ec51aasandwich

    As a web developer, I frequently use a lot of command line tools to make my life easier. I prefer to be able to assemble a computer from whatever hardware I want, so I don’t like Macs and stuff like this. Linux desktops are good enough our days, but I love to play video games from time to time, and it wouldn’t be effortless to keep two different operating systems for work and entertainment. My best compromise was to use Windows.
    Read more
  • Using Letsencrypt with Docker

    5ada4af31481fpexels photo 892548

    Who needs all those paid certificate providers while we have such a brilliant project as Letsencrypt? It allows a domain owner to obtain a valid certificate for his domain in a matter of seconds without the boring stuff like generating CSR, making DNS verification records or even passing documents to the certificate issuer center. However, paid certificates most often have an expiration time of a year. And free Letsencrypt certificates live only for a couple of months. But it’s definitely not a huge problem if there is a way to automate the renewal process. And there it is.
    Read more
  • 2017

    The 2017 year was good for me. It’s the second year in a line where I fulfilled all my new year resolutions, which is inspiring. That’s why I decided to write a bit about it. The year totally earned it :)

    The wedding

    The wedding

    I’m a married man now. I have such a beautiful wife! (and still can’t fully believe that). But I don’t see any changes inside me: I think I married her in my mind long before that, but it’s great to have a real ceremony and to eat a real cake! :) The day before the wedding I fell from my bike and got a severe knee injury. I’ll never forget dancing the waltz all in bandages like a mummy, with terrible pain and only one leg working fine, but it was worth all the efforts.
    Read more
  • Books

    Books were hard to get at a time when I was a kid. They were expensive and, moreover, there was a complete lack of them. Many people owned no books at all, and some other copied them manually (by hand). But there always were a lot of books in our family, and it was shocking to me back then — to see no books at all in a room.

    Not all of the books from our family collection were good. Most of them were pretty cheap detectives and other silly novels from barely known authors. The only thing they were good at is the creation of the warm relationships between me and the book species. But among this mess, there were a lot of hidden treasures.

    Once I spotted that my father left the book he was reading at that time, on the table. I, for some reasons, thought that I’m not allowed to read or even touch adult books as I was a nothing but the little child. No one was near, and I dared to take it and read it, secretly. It was «Lord Valentine’s Castle» by Robert Silverberg.

    To my astonishment, it was not too different by its nature from what I’ve read before. It was way better than all these child books, so I fell in love with it from the first pages. I was reading this book secretly for a long time as I wasn’t alone most of the times and not every day I was even aware of the location of this book.

    I think that at some point my secret love affair with this book was spotted by my father. He said nothing about it, so I’m not sure if that was the trigger. But sometime after that, he offered me another book from his collection of science fiction to read. It was the «Deathworld» by Harry Harrison.

    From that time I created a personal ritual for reading. Every evening, I take a fruit or two, go to bed, take a book and read it for an hour or two. That was the time I first met Heinlein, Simak, Asimov, Zelazny, Sheckley and other cool guys I owe so much for my very own personality, consciousness and the way I see the world now.

  • A Few Notes on Composition of Reducers

    5ada4a05c5b4apexels photo 355288

    Managing the state of an application with libraries like redux is awesome. It provides a really easy way to write simple and testable code for state transitions. You only need to decide on a structure of the desired state and write a corresponding pure function.
    Read more
  • How To Update Cloudfront Certs With Letsencrypt

    Letsencrypt is an excellent service for obtaining totally free security encryption certificates. Fortunately, it also has a marvelous client named Certbot. Let’s install it.
    Read more
  • Sunrise in Moscow

  • Writing Modern SPA in JavaScript: Package Management

    Why yet another one tutorial?

    A single-page application (SPA) is a web application or web site that fits on a single web page with the goal of providing a more fluid user experience similar to a desktop application.

    en.wikipedia.org

    I’ve been thinking of a complete tutorial on writing SPA in modern JavaScript for a long time. «There are a lot of such lessons» — you can say and be 100% right. But most of them have a very confusing part for newcomers: the horrific amount of buzzwords! The days when you were able to write the simplest «Hello World» program in just a few lines of code are long gone. Now you should know good enough answers to many important questions before you could even start coding:

    • What language should I use?
      JavaScript (es3, es5, es6)? TypeScript? CoffeeScript? Whatever-Else-Script?
    • How I should manage my dependencies?
      Can I just copy them to the project? Or should I use git submodules? Maybe I could make a use of some package manager (npm, bower)?
    • How should I assemble my code for frontend?
      Isn’t the old good «just concatenate them all» the best one? Or should I use browserify? A little bit of webpack?
    • How should I use styles?
      Can I just add a style tag with an external css to my HTML file? Or should I use something more complex like BEM? Or can I just inline it?
    • What framework should I use for my application base?
      Should it be vanilla JavaScript? Or jQuery? Backbone? Angular? Maybe Angular 2 (two is bigger than one — therefore it should be better, right?), React?
    • How should I manage the data in my application?
      A lot of buzzwords here. Flow? Redux? Relay? MobX? Can’t I just do it the old good way (like my father and his father did)?
    • Can’t I just shoot myself in the head instead of diving into this mess?

    You can’t write modern JavaScript and ignore those questions. So I’ll try to solve this buzzword-hell-puzzle by starting a new project from scratch. We will be writing a new application with a small steps and every single step will be introducing one thing at a time.

    You should understand: sometimes you can definitely say that the tool named A is better than the tool named B. But sometimes you should also choose from tools with comparable awesomeness — just take the most beautiful one (as you see it now).
    Read more
  • Начните использовать ES6 и SASS в браузерах сегодня

    javascript

    Браузеры всегда были очень инертной средой для исполнения наших программ. Даже когда язык JavaScript ещё не развивался так быстро как сейчас, браузеры уже не успевали за ним. Годами на троне сидел какой-нибудь хтонический монстр вроде IE6 и заставлял с ним считаться каждого. Нам пришлось на долгое время забыть об использовании чистых языковых конструкций и научиться доверять очередной библиотеке, знающей разницу между браузерами и их версиями. Появились армии разработчиков, неплохо знающих jQuery, но как огня боящихся самого языка JavaScript. В то же время, дела со стилями в чем-то были еще хуже. Несмотря на появление множества новых свойств, сам формат не получил вообще никаких значимых улучшений и, в сыром виде, даже сейчас едва ли может быть удобен кому-либо.
    Read more
  • Just saying «Hello» and chilling around

    I have never been really good at writing. I won some rewards in my childhood. I wrote some shitty verses in my youth. None of those achievements really were significant for the universe around me. It was all like a silly child play with the symbols I barely know. Move one back and another forward, make a stanza, make another one, make them a little bit more shiny. I experienced that well-known fear of a blank page. And I experienced that recursive «oh, I can do this paragraph better» annoying thing too. But I love writing, I really do. I have dreamt about writing a book all my life long just like my grandfather had dreamt before me. That’s why I have decided to write my thoughts in English: to master my slack skills with practice that makes me happy.

    We are what we do and what we think about. The oceans of information we swim in are unstable in our epoch. Their coast and bottom are changing their shapes every second with new memes rising and fighting each other to the bloody death. The key point is that those ideas are battling mostly in English. Native speakers are lucky in some way: they don’t need to do anything to be in the middle of that storm and to see every glimpse of new fancy ideas worth knowing about.

    Not that I say that other languages are not good. They are wonderful, all of them. But they act in this battle as smidge waves in the far away bays. And what I am interested in as a contemporary engineer and transhumanist is this battle itself. I want to be in the vanguard of this mess crushing metaphoric skulls with my own great axe of knowledge and will.

    And then again I asked myself a question: «Do I really want to battle ooze and slime in memetic swamps of my native language? Do I really want to waste my life for that dolorous purpose?»

    So here I am now.