Category: Web development

  • Serving Node application in production

    When we want to serve our Node app in production and with best performance, we need to minimize our static files (javascript, stylesheets, images,…), setup Nginx for serving those static files/proxying requests to our application server and installing process manager that will keep our application alive in case of crashes. Minimizing our static files is…

  • Autocomplete in RxJS (code walk)

    Autocomplete functionality is probably the first use case you hear for using RxJS. Here is one possible implementation for it (code can be also found in JSBin): let input = document.querySelector(‘input’) let inputStream = Rx.Observable.fromEvent(input, ‘input’) let ul = document.querySelector(‘ul’) let responseStream = inputStream .debounceTime(500) .map(e => e.target.value) .filter(value => !value | value.length > 2)…

  • Creating database migrations and seeds in Node.js

    This can be all done with knex library, a SQL query builder for JavaScript. In this post I’ll use MySQL (MariaDB) database, but knex also supports Postgres, MSSQL, SQLite3, and Oracle. I will also use faker for generating fake data for seeding the database. Install knex, faker and mysql (or any other driver for database…

  • Specificity in CSS

    Specificity in CSS

    I’ve decided to learn few more CSS fundamentals. Decision was made after being annoyed by using !important too much with one CSS framework. First thing was to trying to learn everything about CSS specificity. It’s the main reason for wondering cluelessly half an hour why some style rule isn’t applied. Than of course you solve…

  • Organizing jQuery code with Flight.js

    If you use jQuery for your projects and don’t organize code in some way, you should definitely check out Flight.js, a web framework created and used by Twitter. Flight.js lets you organize jQuery code in components (basically a self contained HTML markup where standard DOM events are handled by user-defined callbacks). These components communicate with…