Welcome, 2019

I know, we have passed the Happy New Year hype, but this is only the second week of 2019, so no problem about the timing.

Last year was a really special one for me. Among others personal and professional achievements, it was awesome because:

  • My husband and I moved to Vancouver, BC;
  • I’ve been working with Software Development for almost one year now;
  • I started doing private English classes to improve my skills;
  • Set up a Study System that works for me;
  • Financially, it was our best year. Even having some moving expenses, we were able to save/invest almost half of our income.
  • Stopped drinking coffee every day;
  • Read 14 books;
  • Discovered the CBT – Cognitive Behavioral Therapy – techniques (changed my life);
  • I did the Rails Girls Summer of Code program – which was amazing;

So, you can imagine how excited I am for 2019! Before I move on, I wanted to share my goals for this year:

  • Finish SCIP MIT course by December;
  • Launch 2 projects that I chose to focus on (and practice my UX and Software studies);
  • Have better knowledge of Vue.js (JS is not my passion, but it’s always useful);
  • Less shallow activities, more Deep Work;

I chose the word Patience to guide me during this year. And let’s see what 2019 brings to us. Happy New Year!

Customizing the items from a select field using Set operators

I had to customize the items of a select input field for timezones in a form. I needed to show some preferred US timezones first and then list the remaining below them. My mentor sent me this link to help me and I want to share it with you.

It turns out, this is something that you probably saw in a Math class: Set theory. What we need here is what we call Union:

A union is essentially used to combine the unique values of two sets, or in this case, arrays. To perform a union on two arrays you use the pipe as an operator. For example:

[1, 2, 1, 2, 3] | [1, 2, 3, 4] #=> [1, 2, 3, 4]

Mike Farmer

Or visually:

image from mathscrunch

Now that we are a little more familiar with set operators, let’s move to our problem. To keep our code organized, let’s move our code to a helper:

 # we use helpers to extract logic from our views
  
def timezones
  priorities =
    [ ActiveSupport::TimeZone['Eastern Time (US & Canada)'],
     ActiveSupport::TimeZone['Central Time (US & Canada)'],
     ActiveSupport::TimeZone['Mountain Time (US & Canada)'],
     ActiveSupport::TimeZone['Pacific Time (US & Canada)'] ]
    
  priorities | ActiveSupport::TimeZone.us_zones
end

So first we have a list of the preferred timezones, then we use the | operator to show those first and after that, show all the US time zones that aren’t included on the priorities list.

Now we just need to call our helper method on our form:

# html.slim

= f.collection_select :time_zone, timezones, :name, :to_s, {}, { class: "form-control" }

And voilà, that’s the result:

ta-da!

Whenever you have a similar problem, you can follow this approach. Hope you liked it!

Some awesome Bootstrap 4 Responsive Utilities

Bootstrap has made our lives easier because of its responsive utilities (recommended having a basic HTML and CSS knowledge before playing with Bootstrap).  I’ve been using Bootstrap 4 for the past 7 months and I was surprised at the really good features and amazing utilities they released on this version. I want to share some valuable lessons from studying those docs. And please, if you have others as well, please share! 🙂

Bootstrap Grid

To give a brief context, keep in mind that Boostrap uses a property called Grid System. For this tutorial, all you need to understand is how those grids are broken into five  breakpoints, one for each screen size, from extra small to extra large devices:

// Extra Small devices (Portrait phones)
// .col-xs-*
@media (min-width: 576px) { }

// Small devices (Landscape phones)
// .col-sm-*
@media (min-width: 576px) { }

// Medium devices (tablets, 768px and up)
// .col-md-*
@media (min-width: 768px) { }

// Large devices (desktops, 992px and up)
// .col-lg-*
@media (min-width: 992px) { }

// Extra large devices (large desktops, 1200px and up)
// .col-xl-*
@media (min-width: 1200px) { }

That means you can modify them as you need and being aware of those breakpoints is pretty useful, including when you want to show or hide some content dependig on the screen size.

Usage

Now let’s go to the fun part, the examples:

  • To maintan a consistent responsiveness to you app, use col-* , so you don’t need to rely on any breakpoint to organize the elements on your page (keep in mind that depending on what you want, you may need to set a breakpoint):
// Regardless of the screen size, the columns will always have the same width

<div class="row">
  <div class="col-3">
    <div class="card">
      <div class="card-body">
        < ... >
      </div>
    </div>
  </div>
  <div class="col-9">
    < ... >
  </div>
</div>
  • Hide content depending on the screen size:
// this card will be visible only on lg screen

<div class="card d-none d-lg-block">
  <div class="card-body">
    < ... >
  </div>
</div>
  • If we want to the opposite, i.e., show on every grid except on the lg sizes, we can use the .d-lg-none class to the element:
// this list of icons be hidden on screen >= lg

<div class="fixed-bottom">
  <div class="card d-lg-none">
    <div class="nav-icons card-body">
      < ... >
    </div>
  </div>
</div>

Example

Here I have a screencast showing all of that together, resulting in a very fully responsive page, without any weird behaviour when switching between the screen size:

Hope you liked this. I was really impressed of how Boostrap 4 has made our lives easier. Enjoy it!

Creating your own Ruby new method

I’ve been studying more of Ruby from RubyTapas and I even got back to an old project of mine, the RubyFarm. I’m here today to show one really cool thing that I learned today: how to personalize the new method.

In order to do that, Ruby needs from us three things (from RubyTapas):

1 – Allocate a new, empty object of the given class.
2 – Run any specialized initialization code defined for the class
3 – Return the initialized instance

So if we would rewrite the RubyFarm Animal new instance method, for example, we could do something like:

class Animal
  def self.create_new(*args, &block)
    instance = allocate
    instance.my_initialize(*args, &block)
    instance
  end

  def my_initialize(breed, age, weight, last_vaccine)
    @breed = breed
    @age = age
    @weight = weight
    @last_vaccine = last_vaccine
  end
end

bob = Animal.create_new('domestic cat', 5, 8, 2017)
p bob # => <Animal:0x00005644aaa17800 @breed="domestic cat", @age=5, @weight=8, @last_vaccine=2017>

And voilà! Ruby really makes it easier to creates your own methods. Thanks, Avdi for all of those lessons 🙂

Hope you found that as awesome as I did when I learned this. See you next time!

Rails Girls Summer of Code logo

Rails Girls Summer of Code 2018

Rails Girls Summer of Code is a great way to practice your code skills after attending to one of the Rails Girls workshops. You can work on an Open Source project during the Summer, having a whole team to support you: teammate, a mentor, coaches and a supervisor to support you during this journey. I still get excited when I remember that this program is totally funded by the community (and also some cool sponsors!).

I am so happy to say that my team, Brazilian Housewives coding, was accepted this year! They recently posted my team Introduction blog post from the official blog in Rails Girls Summer of Code. Check it out the other team’s posts there too, they are all amazing!

About us

Hello! We are Stefanni and Camila, two junior software developers from Brazil, based in Vancouver, Canada. We didn’t know each other before the RGSoC and we are more than happy to introduce our team!

Stefanni

I am a millennial that likes to cook, coding, cats, playing sports and eating chocolate. I moved to Vancouver in January because my husband received a job offer to work here and we brought our two cats with us.

My history with Rails Girls began in 2015. Actually, Rails Girls is the reason I decided to start Computer Science college in 2015 ( I only did 1 year and a half, now I am studying by myself). I went as a student in the Rails Girls Sao Paulo 2015 workshop and since then I wanted to join the RGSoC, but I never applied. I was also a coach on the 2017th edition and it was an amazing experience.

The other coach of my group introduced me to the CTO of a Brazilian fintech where later I did a brief software internship before moving to Vancouver. So imagine how happy I was when Ana and Vaishali surprised us announcing that we were selected, Rails Girls has been playing an important role in my tech career!

Camila

Hello everybody, my name is Camila! I’m a Brazilian living in Vancouver with my husband. After finishing our master’s degree in Computer Science last year we came to Canada with our two cats – the flight was a great adventure!

During graduation I worked with Recommender Systems, characterizing the consumption over time in recommendation domains, and in social network analysis. In my master, I was interested in understanding how sociological aspects are reflected in current technologies, such as the existence of racial bias/stereotypes in search engines, and what is the role of the algorithms on the propagation of these bias/stereotypes. I’ve been working with academic research since my first year as an undergrad student. And my plan was to finish my master’s degree and then apply for a Ph.D. But for now, I feel the need to apply my knowledge to something that is really going to be used by several people and not only in the academic environment.

I learned to code in my early years of graduation and I have a good experience with algorithms. I have good knowledge of Python, C, R… But I have almost no experience in software development, software engineering, testing, etc. So I think the Rail Girls program will be a great opportunity to be part of the Open Source community and learn a lot!

How did we meet?

Because we are both relatively new to Vancouver, it was difficult to find a teammate here. So we used the RGSoC google groups to search for teammates and there was where we met each other. We went to a coffee shop and discussed our application and we soon got along, especially because we both have cats =).

Thanks, RGSoC organizers for providing these mediums for us to find a teammate 🙂

How is work going?

This week has been great! We are reading and collecting information from the Public Lab codebase and the API docs/tests. Also, we focused on learning more about Git, RESTful API’s, and how to document code changes.

We also want to thank the Predictable Revenue for letting us use their space to work. Thiago, one of our coaches, works there and we asked if we could work there. The office is great and it’s located at the historical site of Vancouver, a central location in the city.

Camila, Julio, Stefanni and Thiago on our first day! picture taken by Stefanni Brasil

Camila, Julio, Stefanni, and Thiago on our first day! the picture was taken by Stefanni Brasil

Meet our Amazing Team

Coaches:

Thiago Araujo and Julio Albinati. Thanks for being our coaches, we couldn’t be part of this amazing program without your help.

Mentor:

One of the reasons we applied to work at Public Lab is because it’s a very inclusive and supportive community. Jeff Warren is always helping us and we are happy to be part of it.

Supervisor:

Mayar is our RGSoC’s Buddy and we want to thank you for all your support and advice for us to have a great summer of code.

Thanks, everyone for helping us and for being part of our team, you are amazing! 🙂

About our Summer Project

We are working as a part-time team on the Public Lab app, more specific on the API feature. We have a Planning Issue here with the Timeline and a Github Project page if you want to check out and/or give some help and tips 🙂 We don’t have much experience working with API’s so we are really excited to learn everything that we can this summer.

So, why Brazilian housewives coding?

We are junior developers and have only been living in Vancouver for a few months. We were both beginning our career in Brazil when our husbands got a job offer to move to Vancouver so we were having a hard time finding opportunities for juniors here. We thought it would be a good name to play with our status here! 😛

What do we expect for the RGSoC 2018?

  • Understand more about modeling an API
  • Become more familiar with SQL queries
  • Be experts on Ruby on Rails
  • Learn more about JavaScript and Tests
  • Improve our documentation skills
  • Be just the beginning of this amazing Open Source adventure
  • Have a great Summer!

Github guide for Open Source Contributions

I’ve always wanted to contribute to Open Source projects and I am proud to say that recently I achieved that by doing my first code contributions to some cool projects! There are lots of resources online about contributing to Open Source Projects, especially from Github, but it doesn’t hurt writing another one, right? And writing this Guide will help me because now I don’t have to search the commands every time 🙂

For me, the hardest part was finding a project where I felt welcomed as a beginner and comfortable with the technology used. I was looking at the Rails Girls Summer of Code projects and after some days, I started doing contributions to Public Lab and If me organizations.

If I am in any position of giving an advice, I’d say to look out for projects that you feel comfortable and that makes sense to you and to your learning path. It probably isn’t a good idea to start contributing to the Linux kernel, if you are learning how to program, for example.

You can take a look at the open Issues and choose one that you want to work. If you think you can work on an Issue, for example, but need to clarify some things, go ahead and ask the team! 🙂

Another thing that is helpful in this discovery adventure is to read the documentation. Providing a careful documentation usually says a lot about the team communication and organization.

I like to follow these two guides from Lucas Mazza and Thoughtbot to help me with Git in my contributions. I recommend you to read these two before going further.

Setting our application

Now that we have selected the project and selected an Issue to work on, we must go to their repository and click on the ‘Fork’ button:

This will create a new repository in our Github Account with the current state of the application. You can see it by clicking on your account’s repositories. That’s the repository where we’ll add our changes, instead of playing with the original. This is good because it guarantees that we’ll never affect the original repository, so we won’t be afraid of breaking something and focus on our work 🙂

Now, on our local machine, we clone our forked project (remember to modify the personal info with yours):

git clone git@github.com:stefannibrasil/plots2.git

The next step is to make sure everything is running okay, following the project Installation guide. After that, we can go ahead and create a new branch in our forked repository:

git checkout -b 'my-new-branch'

It’s up to you if you want to create a new branch or work on your local master. I prefer always having a branch for each new feature.

Now we have everything ready for our actual work! Remember to write good commit messages and provide good context for the reviewers while doing them. This post helped me a lot with that 🙂

Submitting our changes

When we are done with our changes, the next step is to open a Pull Request to say that we want to merge our changes into the original code. Normally, visiting the Github project page after pushing changes from a local branch will put a notice with the branch name.

I find it easier to open the Pull Request just clicking on ‘Compare & Pull Request’:

But if that doesn’t happen, you can do that by clicking on ‘New pull request’ and search for your branch there.

Note: If you aren’t done yet but you want to know if you are on the right path, you can always open a new PR to get some feedback. Just add a ‘[WIP] – Add new feature’ to its name and ask for a review.

Keeping our forked repository updated

Because other people are making modifications to the code at the same time, our forked repository needs to get these changes frequently, so we will always have the updated code to work on.

We can do that by adding the project repository as one of our remote repositories. We can copy the link provided in the original repository ‘clone or download’ button and run the following command:

git remote add upstream git@github.com:publiclab/plots2.git

Now if we run

git remote -v

we should have two remote repositories listed, ours and the project’s:

origin git@github.com:stefannibrasil/plots2.git (fetch)
origin git@github.com:stefannibrasil/plots2.git (push)
upstream https://github.com/publiclab/plots2.git (fetch)
upstream https://github.com/publiclab/plots2.git (push)

Now run these on master:

git fetch upstream # to retrieve new work done by ther people
git rebase upstream/master # to rebase upstream into your master
git push origin master

If that ran smoothly, you must see that your forked repository is even with the original:

If you’ve created a branch as I did, run the following command to also rebase your branch with the updated master:

git checkout my-new-branch
git rebase master/my-new-branch

Now we have our repository updated and that will decrease the number of conflicts in the future. If conflicts happen, it’s not the end of the world. Git usually provides helpful messages about the errors to guide you while solving them (and Google, always).

Some notes

After doing your first Open source contribution you’ll likely find out that the code that you change is just half of the work. You need first to communicate with the team, see if you understand the problem and ask for help, for example.

But don’t worry if you don’t feel ready to do any of this. Don’t let that hold you back. If the project you choose is beginner-friendly, the team will help you with anything that you need. Besides, you’ll learn a lot from this experience, trust me.

Another note that I want to share is this video from Eileen. She talked a little about her Open Source experience developing a feature for Rails 5.1:

And that’s it for today. I hope you find this Guide useful. If you have anything to suggest or add, please, add a comment below 🙂 See you next!

 

Some random thoughts

Hello, there!

It’s been a while since I don’t write anything here. For those who don’t know, my husband and I moved this year to Vancouver, Canada and that took us some time to solve everything but now I am back! 🙂

This got me thinking about how hard it is for us, humans, to change. This isn’t my first moving, in fact, this is the 4th time I am moving to another city in the past 10 years. You have to start everything again: meet new people -hopefully, make a new friend- learn the culture, habits, etc.

But you don’t need to move to another country to change any aspect of your life. No matter what it is, you have to show up and say to the world what you want. The best opportunities that happened to me was because I pushed myself to go there, even when I was in doubt. I am not saying every opportunity will be great, but at least you’ll learn something from the experience.

Don’t think I didn’t feel scared. I was, but I am feeling better about my choices since I started trying to think about what could go right, always. You should try it.

How to apply your coding skills to turn yourself into a self-made millionaire

Before you start to read, I have some things to say. I am not a millionaire *yet*. I like coding and studying investments. And lately, I’ve been reading a lot about Business and how to create a product in order to generate passive income that will help me achieve financial independence faster.

I have been following some people from Indie Hackers and what I really like about this community is that you don’t need to create the next revolutionary startup (unless you want it) to be in business. There’s a lot of people who solved a problem they faced for months or years until they saw there was an opportunity to start a small business and make some money.

Eventually, your business can get big or not. And that’s okay if that’s okay with you. You don’t need to be the next Google, the next Uber in order to be successful, and you don’t even need investors. Startup life is something that you really should get to know well before jumping in because it can be (stressful).

I was reading Stephanie Hurlburt blog another day and I found this great article about software development and Business :

I know many developers who are essentially making products and giving them away for just a salary or throwing them out because they don’t truly understand their worth. Next time you work on a project, really think about what your work is worth and get creative about how to get at that.

This reminds me that, as a developer, I have a feeling that almost everybody I know don’t believe they can run a business, so they don’t even try. Of course, for us, marketing and dealing with clients isn’t something that we would usually bet our money on. Sales and software development are totally different things, and it’s hard to sell something to a client that wants something you know it’s impossible to do build as a developer.

But that’s worth trying. Do the math: let’s say your product generates a recurring monthly revenue of $ 1,000. Multiply that for 12 months (1 year) and for 60 months (5 years). That’s a nice amount of extra money, right? That money could be put into investments. When you get the taste of making more passive income I don’t think you’re gonna settle for less.

Think about being financially independent. Don’t get me wrong, I know that will not be easy. But wouldn’t that be great if you had to work only on what you love and not because you have to pay your bills? Wouldn’t that be great if you had the time (the most expensive thing in this world) to live your life the way you want it? That’s the spirit. Set your goals and don’t settle for less, my friend.

Let me know how many of you already have a business and how many of you are interested in having one. Cheers!

Fui no Rails Girls, e agora?

Esse ano a edição do Rails Girls São Paulo aconteceu no fim de semana passado, nos dias 18 e 19 e foi no espaço roxinho da Nubank. Em 2015, eu fui como participante (você pode conferir minha experiência aqui neste post) e este fui como coach, uma promessa que tinha feito pra mim mesma. Foi uma experiência que acredito que todos devam passar, pois o pouco que sabemos (ou que achamos saber) pode ajudar alguém e mudar a vida de todos nesse processo.

Uma das coisas que mais me deixam feliz nesses projetos voltados a incentivar mulheres a programar é a temática dos projetos que as participantes sugerem. É incrível a quantidade de ideias e propostas que surgem da realidade das pessoas que não são representadas na tecnologia. Eu sempre acreditei no poder da tecnologia e do conhecimento para mudar a vida de muita gente e ver isso na prática me deu mais gás para seguir com os meus projetos e espero que você também 😀

Bom, a intenção deste post é dar uma sugestão de guia para quem quer continuar a programar com Ruby on Rails. Desde já, aviso que é bom você não perder contato com sua coach, pois as dúvidas surgirão e é fácil querer desistir diante de um problemão que não temos ideia de como resolver. Mas com paciência, você chega lá e é muito importante ter uma mentora no início, acredite em mim.

Minha dica é separar um horário por dia, como por exemplo, 30min por dia. Pode parecer pouco, mas não subestime suas escolhas do dia a dia e o impacto que isso traz daqui uns anos na sua vida, 🙂 O ideal é praticar todo dia, assim você relembra mais facilmente o que você fez e praticando diariamente você se compromete consigo mesma, que tal?

Os projetos que sugiro são:

1 – Agile Web Development with Rails

Livro muito bom (de graça!) que ensina a construir um e-commerce, usando metologias ágeis, testes e git :). Muito bom para dar continuidade ao que vocês aprenderam.

2 – The Odin Project

Conheci esse projeto uns dias atrás, é muito bom! E tem uma comunidade bem ativa também, portanto, dúvidas são comuns e você pode conhecer outras pessoas que estão aprendendo também. Já se inscreve e faça um pouquinho de cada vez.

3 – Code School

Esse site é pago, mas se você puder/quiser investir, recomendo. Alguns cursos sao gratuitos, mas a maioria é pago.

4 – RubyThursday

Site muito bom que conheci mês passado. Nas quintas você recebe uma newsletter com tutorias curtinhos, dicas e truques para quem está começando uma carreira de desenvolvodera Rails 🙂

Bom, não adianta nada encher aqui de links, no começo pode assustar, então, se quiser começar nessa ordem, acho uma boa. E sempre lembre que o Google e o StackOverflow serão suas melhores companhias a partir de agora. Só vá com calma, entenda que leva um tempinho até tudo começar a fazer sentido, mas se você gostou de programar, então tudo isso vai valer a pena e é um processo muito bacana. Espero vocês como coaches nas próximas edições, combinado?!

PS. Fui coach junto com a Débora (manja muito de Rails :P) e meu time foi o da Henritta Swan Leavitt (os nossos dos times eram de mulheres cientistas 😀 e tem uma fotinha desse time maravilhoso que tenho orgulho de dizer que fiz parte) e o nosso projeto foi o de listar centro de doações no Brasil, o Doe Felicidade. O código está no github, então, quem quiser contribuir, fique à vontade! É bem legal dar continuidade à ideia, pois você aprende, monta um portfólio e ajuda muita gente por aí <3

 

 

#VamosJuntas

What nobody tells you when you decide to learn how to code

If you decided to change your career to a technology related field, you probably faced some internal demons. And the first thing that I want to say to you right now is: it’s hard, but not impossible and it’s worth it. And you’re not alone! I was tired of reading only the good and fun and the unrealistic reality of learning to code, so I want to share my experience and hopefully help someone.

When I was first introduced to coding, I fell in love with programming. Since then, it’s been a roller coaster of feelings and motivation and this year I finally started to feel more confident about my choice.

I see some people saying that programming is super easy, that everybody can learn, etc. Sure, I do believe that everybody can learn, but if you don’t have the passion or the curiosity, I have to say that you will eventually feel like “oh, this is not for me”. And the worst, you will think that you are the problem… “if this was supposed to be easy and I can’t code, then the problem must be me, right?”

Wrong, so wrong! It is a process and there are some things you have to learn in order to survive this journey.

So here are some things that I have learned in the last 1 year doing Computer Science and how I am motivating myself to be a better developer while finishing my degree:

1 – It is hard

Even if you did not have a good education in science and mathematics, that should not stop you. It’s all about how bad you want it.

2 – You have to learn to be patient and resilient

The reality is that you won’t solve all the problems at first, but that is okay. Every time you overcome a challenge you become better and more confident. The point is: you have to learn how to learn and how to persist in face of the daily difficulties.

3 – Do a project that you love, yeah… but it’s not about the destination, it is about the journey

What about when you decide to develop something you love but you have no idea how to start? Search for good practices, good tutorials and ask for advice from someone you feel comfortable to ask. Sometimes you may find yourself struggling with something, but with a little help from your friends, you will get it and sometimes learn more than just how to solve that problem 🙂

4 – Do not ever compare yourself to others

I say this because my boyfriend has almost 8 years of experience in software development and I caught myself having high expectations although I am still learning to code! Frustration is not good, but if you learn from it, you will be okay. So, be careful when comparing yourself to others. Instead, try to learn from their experiences too.

5 – Have fun

Coding is one of my favorite things and sometimes I feel like I am missing this part because I am worrying too much about finishing the semester and doing other personal tasks. But, hey, focus on the present and be proud of yourself because you are investing in the most important thing in the world: your education. And nobody will stop you!

So, what are the others challenges that you faced when you changed your career? I would love to know more about other experiences and learn more. Cheers!