Myths of the Near Future

by Yanis T

Ruby and JavaScript enthusiast.

Read this first

Spell checker in VIM

Only recently I figured out that there’s a built-in spellchecker in VIM. You can turn it on with

:setlocal spell spelllang=en_us

Now VIM will highlight any misspelled word. You can navigate between them with ]s and [s. z= will show you a list of suggestion, and if you’re sure the word spelled correctly, you can type zg to add it to the dictionary.

Continue reading →

11 JavaScript Blogs to Follow in 2017

There’s a huge benefit in running a JavaScript newsletter. You get to know about many smart people from whom you can learn a lot.

Here are the most interesting blogs I stumbled upon. Feel free to add them directly to your preferred RSS reader. This stuff is profound, professional and of a very high quality.

Without further ado, in no particular order.

②ality – JavaScript and more
Dr. Axel Rauschmayer aka 2ality is an iconic figure among the community. He writes about new ES6 and ES7 features. His write-ups are usually lengthy and very detailed. He is also the author of very thorough books

Reginald Braithwaite
Reginald is the author of the brilliant JavaScript Allongé which teaches JavaScript but takes a more functional approach. His blog articles are deep and extremely interesting.

μ (yes, just like that)
This one is not on JavaScript in particular but rather on functional

Continue reading →

Browsing changed files in Vim with FZF

I use junegunn/fzf to browse files in Vim. It’s an extremely fast fuzzy finder written in Go. If you compare it to something like [CtrlP](kien/ctrlp.vim) you’ll find it blazingly fast. And what’s cool, it doesn’t need to cache files because it’s THAT fast (no need to hit F5 every time you add a new file into the project). If you didn’t hear about it go try it out!

My most used command is obviously:

noremap <Leader><Leader> :Files<cr>

, which opens the dialog with all files in the working tree to fuzzy find from. I find <Leader><Leader> combination very handy (it’s similar to Shift-Shift in Intellij-based products).

Sometimes (quite often actually) in the middle of development cycle I don’t immediately remember what file I need. In this case I don’t want to see all the files in the working tree, I just want to browse the files I’m working on right now i.e. changed files and newly

Continue reading →

Essential Form Interactions

There are several important features every form should have, be it a simple login form, or a complicated multi page questionnaire. Most of them are really easy to implement but are often neglected. On the other side as from user perspective we absolutely anticipate them and lack of those small interaction makes us frustrated.

Disclaimer: I’m not a UX-expert myself, just an ordinary developer :) But I do believe that world could be a bit better place if we stick to following simple rules. I also should mention that most of time UX- and UI- guys just don’t think on that kind of details. So in the end it’s us, developers who should take care about it.

 Autofocus in first input

Reaching out for a mouse is annoying and unnecessary (that’s a main line of this article by the way). Simply, put the cursor into the first input of the form, so that user could start typing right away. This is

Continue reading →

Simple tabs directive: Angular transclusion, isolation and controller in action

Sometimes when there’s too much content for one page it’s convenient to hide some of it behind the tabs. Basically you can click on a tab to display one page or another. It comes quite handy and I use it a lot in many of my webapps. I came up with this handy directives that allows for dropping tabbed content pretty much anywhere on a page.

What I like about it is that even though it’s quite simple and concise it touches a lot of Angular concepts that believed to be complex and hard for beginners like transclusion and controller.

Interface is quite simple:

  <nge-tab name='books' title='Books'>
    <!-- Some content here -->
  <nge-tab name='reviews' title='Reviews'>
    <!-- Some content here -->

Let’s look under the hood

Here’s nge-tabs:

angular.module('readn.directives').directive 'ngeTabs', ->
    restrict: 'E'  # it only can be

Continue reading →

Why I don’t care about quick sort

I have to make a shameful confession.

Being a professional developer for 8 years now, I don’t know how to implement a quick sort. Or merge sort. Or whatever sort. I mean, I know the words, so I can try to make use of my brain and come up with some approach, but that attempt would probably fail. And when you start throwing these O(n), O(log n) things at me I would probably just roll my eyes ant try to disappear.

Now before you run to unsubscribe from this blog, let me try to explain what I mean by this, and why I really don’t care.

Let’s say that you’re hiring a developer for your super awesome startup. And I’m among the participators. The reason your company exists, is obviously making money. And whatever actions you do running it (including hiring engineers) have only one end goal — make more money.

Now if we try to make a logical connection between me as your engineer knowing

Continue reading →

Adding Logging To Objects With Help Of Metaprogramming

Metaprogramming in JS is not as much as big buzz word like say in Ruby. Partly perhaps because the whole experience of coding in JavaScript is one big meta-programming experience. But sometimes there are those small little hacks that make our life as developers easier, and I think “metaprogramming” is just the right term to describe them.

Let’s say you want to modify the behaviour of an existing Backbone view.

Have you ever had this feeling. You look at someone’s code. And you’re just trying to understand, what’s happening there. What methods are being invoked, and in what particular order. Wouldn’t it be nice if Backbone could log every method being invoked into console, maybe with some meta information like when it started, when it finished, how long did it take, etc.?

Well, there’s a really easy way to do this.

Let’s say, we have a Backbone view with several binded events, lot’s

Continue reading →

Why I prefer Vim To RubyMine

I’ve been using Vim for several months now, which means I’m not even close to some of the professionals, but I still like it a lot. People ask me whether or not it improves my productivity, well It definitely does.

But not in the way you probably think of.

 Wanna edit text faster?

Comment from the same thread

Vim lets you type, navigate and edit text fast. Or even really really fast if you use all of the navigation patterns and keystrokes, understand modes and run macrosses.

The thing is that we as programmers don’t just type text.

The vast majority of our time is being spent thinking about architecture or business domain or tracking some nasty bugs. Not typing. Even though Vim does improve our typing capabilities, it doesn’t improve our overall productivity much by doing this.

So this is not what sells it for me.

 Vim is light

JetBrains RubyMine is very mature. It can do things like syntax checking, fuzzy

Continue reading →

Introducing Full-Scale JavaScript

Just wanted you guys to know, that I’ve started a weekly newsletter on revue recently in which I gather the most interesting stuff from the JavaScript world. It mostly focuses on ES6 and ES7 features, frameworks like Angular and React and functional programming.

If you’re interested in being on the edge, then you might wanna check it out.

The latest issue.

Subscribe to Full-Scale JavaScript here.

Continue reading →

Running Gulp tasks synchronously

Gulp tasks run asynchronously. For example when you describe your build task like this:

gulp.task('build', ['clean', 'html', 'sass', 'coffee']);

you can’t be sure in which exact order the tasks will be finished. Sometimes this is the source of problems. For example, if sass task is trying to compile your styles into the build directory and at the same time clean trying to empty that directory, you can get in a lot of trouble.

Now one way of solving this is to specify task dependencies. You declare you sass, html, coffee as being dependent on clean:

gulp.task('sass', ['clean'], function() { ... })
gulp.task('html', ['clean'], function() { ... })
gulp.task('coffee', ['clean'], function() { ... })

Gulp will guarantee that these tasks will start running only after clean is finished. Which of cause is nice, but if you use livereload and watch sources to recompile on the fly, this can

Continue reading →