CoderDojo workshops

Ones a week I’m teaching others at CoderDojo workshops. CoderDojo is a place for young people (not only young by age but also young by mind) which like to learn Computer Science. When I say Computer Science I mean: programming, game and website creation, graphic design, 3D printing, animations, video creation, robots and many many more. Only yours imagination can limit your skills connected to Computer. On this classes is only one rule: Just be cool! CoderDojo is places where everyone feel good and can learn new things. BTW we are looking for new mentors. All people which like this...…

Rails Girls Szczecin (22 – 23 August 2015)

This time I won’t be writing about technical things. This time I’d like to share with you something very special for me. Something that brings me lot of joy and happiness. Last weekend I’ve spent as a mentor on Rails Girls in Szczecin. It was my third time. I always have great memories with this place. People are so nice and helpful. The workshop was prepared perfectly. The atmosphere was so positive. If you like to be a part of Rails Girls workshop I truly recommend Szczecin. It’s a great place to start your programming adventure. Ok, I was on...…

SessionsController refactoring

A few weeks ago I worked on code like this: class SessionsController < ApplicationController respond_to :json, only: [:create] def create @user = User.find_by(email: user_params[:email]) if @user && @user.authenticate(user_params[:password]) @user.token = Session.create(user: @user).token end respond_to { |format| format.json { render_user } } end private def user_params params.require(:user).permit(:email, :password) end def render_user if @user render json: @user, status: :created else render json: { errors: 'Email or password was invalid' }, status: :unprocessable_entity end end end When you look on this code at first time, you probably think that this is not too bad. Class isn’t to long. It have about 25 lines....…

Custom Rails Validators

For a few days I worked on custom validators in Rails. First what are validators? When you want to check some data which comes to your application, you use validators. For example: if email has specific format, if number is odd, or if you simply want to check if name is required for all of this we use validators. Rails has many different validators already in side. Check the documentation. But sometimes you want to do more. In my case I need validator for black list of words for string field. I know I can use build-in validator. But I...…

RVM – Ruby Version Manager

I hit on an idea how to show: What exactly is RVM? RVM is like house with flowers. Each flower need special living conditions. One of them likes water, other doesn’t like strong light. If we want to flowers grown, we need to take care about this specific living conditions. In this cases help us RVM. Each project wrote in Ruby on Rails needs special environment. RVM help as to keep environments separate without problems. …