Rack::Attack testing with Rspec


Let’s say you are using Rack::Attack. And if you not, you’d probably want to see it. Long story short, it’s a simple middelware for Rails to prevent some (most stupid) attacks to your site.

So if you are using it, you’d possibly want to test it. Just a small example of throttling (don’t mess up with trolling) tests: Continue reading


DigitalNoMad in Moscow


I’ve lived in Moscow for about 10 years and 2 of them as nomad (freelancer, remote worker as you prefer).

After that 10 years I’ve moved to St.Petersburg. But I need to say that live in Moscow is quite interesting and different from any other place in Russia.

They say “Moscow is not Russia” and I mostly agree. Continue reading

Does Naive Bayes Belive in a Big Foot?

There is a quite interesting, widely-using and powerful theorem in a probability theory: Bayes’ theorem. In AI this theorem are used for “Naive Bayes classifier” algorithm.

Why this theorem is interesting? Because in many cases of machine-learning it could give you good result and it’s really simple to implement this algorithm. For example, with Naive Bayes help many spam-filtering systems are working.

Why the hell it’s “naive”? Continue reading

Google Trends API + Golang

Google trends is a really nice stuff, when you try to compare what is more popular: cola or pepsi, whiskey or soda?

So I wondered, is it have any API. With a bit of googling I found they have some kind of.. unofficial though. With special formed query anybody can obtain javascript-ready string with whole data: example.

Not so friendly as before, huh? But it’s still something.

With zero knowledge of golang, and with only help of online documentation to this great language (so I pretty sure you can do better!), I’ve created this command-line tool.

You can run it with two paramethers and have the “rating” of first and second as an answer.

That was pretty much just go-practice.

Month With No Social Networks

What is Itching

Recently I’ve noticed I spend too much time in social networks, doing nothing, just browsing. Reading “news” and reposts of funny videos from the people I used to know.

I can’t feel I can retreive any useful info there. Just wasting time. But it turns to be my main excercise any time I have some “free time”.

I’ve started my day with browsing friend’s posts in facebook. I’ve finished my day with browsing instagram posts. During dinner, while waiting anything… Really destructive. Continue reading