Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am krasnoukhov on github.
  • I am krasnoukhov ( on keybase.
  • I have a public key ASBgn51BbUX1N1f3Sa7m7ZKIEHfT_FXhmmQIOO0m2CeWkwo

To claim this, I am signing this object:

View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
View container.json
krasnoukhov / output
Created Apr 17, 2015
ember-cli output
View output
krasnoukhov in ~/Downloads/my-app 💃 PATH=$PATH:./node_modules/ember-cli/bin/ ember server
Future versions of Ember CLI will not support v0.10.36. Please update to Node 0.12 or io.js.
version: 0.2.3
Could not find watchman, falling back to NodeWatcher for file system events.
Visit for more info.
Livereload server on port 35729
Serving on http://localhost:4200/
Build successful - 5327ms.
krasnoukhov / omg.rb
Last active Aug 29, 2015
View omg.rb
omg = do
attr_accessor :test1
attr_accessor :test2
def inspect
puts "test1", test1.inspect
puts "test2", test2.inspect
puts "="*40
krasnoukhov /
Last active Feb 25, 2020
Profiling memory leaky Sidekiq applications with Ruby 2.1

My largest Sidekiq application had a memory leak and I was able to find and fix it in just few hours spent on analyzing Ruby's heap. In this post I'll show my profiling setup.

As you might know Ruby 2.1 introduced a few great changes to ObjectSpace, so now it's much easier to find a line of code that is allocating too many objects. Here is great post explaining how it's working.

I was too lazy to set up some seeding and run it locally, so I checked that test suite passes when profiling is enabled and pushed debugging to production. Production environment also suited me better since my jobs data can't be fully random generated.

So, in order to profile your worker, add this to your Sidekiq configuration:

krasnoukhov / Gemfile
Created Nov 5, 2014
SAXMachine nokogiri proof
View Gemfile
source ""
gem "sax-machine", github: "pauldix/sax-machine"
gem "nokogiri"
krasnoukhov /
Created Oct 2, 2014
Brewing filtered coffee (essay)

Brewing filtered coffee

It's no secret there are a lot of ways of brewing a cup of delicious coffee. Basically, coffee can be prepared through the boiling, steeping, filtration or by using the pressure. I find filter-based brewing the most convenient in terms of operational simplicity and resulting flavour, so let's see how exactly it can be prepared.

The common idea between different filter brewing methods is that water is poured into the pot through the grained beans, and filter helps to restrain beans from getting into it. However, there are things that may vary, such as water temperature, beans grind level and the design of coffee pot itself.


Baruco 2014 talks

mruby: AltRuby


Standard Library, Uncommon Uses



View intra
$ time telnet memcached.theoldreader.intra 11211 | echo quit
real 0m5.026s
user 0m0.015s
sys 0m0.007s