Bits & bobs from the last two years…1

Over the last two years I have accumulated ideas for blog posts. Some of which are no longer relevant, some of which will turn into full blown posts and some of which I want to sure bits of.

So, here are the bits and bobs from the last couple of years! Enjoy!

Mistakes Programmers Make Over and Over

One of my teachers at Enspiral Dev Academy was Samson Ootoovak, who I also have the pleasure to work with at Flick Electric Co. Just after I graduated from EDA in July 2015 he wrote this blog post – Mistakes Programmers Make Over and Over. The main points being:

  • Read the errors
  • Copy-paste trouble
  • Keeping your branches small
  • Quickly not writing tests
  • Starting is better than perfect
  • Everyone is better than me

Most of these mistakes I made a lot when I started out. I can even remember asking Sam for help during the last phase of bootcamp and it was an issue with not reading the error properly.

I still make these mistakes, but less often (just making new ones now!) and I now recognise sooner what the mistake was and make corrections quicker.

It is a good reminder to come back and reflect on these and also take the time to reflect on how much I have learnt over the last two years since graduating.

(Oh and I also think one of his more recents posts would be good to book mark if you ever consider submitting a call for proposal (CFP) – My First CFP)

Tools – editors, terminals, linters

I started out using Sublime as my text editor of choice and iTerm for the terminal/console.

I’m big on how things like and while using Sublime I discovered the cobalt2: a theme for Sublime Text. And the same one for iTerm – Cobalt2 for iTerm2 and ZSH.  Then I transitioned to using Atom as my text editor of choice, where you can also use the cobalt2 theme.

My old friend, Samson, got me into using zsh and oh-my-zsh. And then I discovered that Wes Bos (ps, Wes is also the creator of the cobalt2 theme!) had made this cool and very useful video series – Command Line Power User. If you are using zsh, I highly recommended. If you are not using zsh, why not?

Starting out in Ruby land I discovered the Ruby Style Guide. And then learnt about linters! The one I use for ruby is RuboCop and you can also get it working in a text editor – https://atom.io/packages/linter-rubocop.

 

More “Bits & bobs from the last two years…” to come! 😁

 

Advertisements

Gem Error

So, another thing that I haven’t spent the time to fix on my Mac at home is this issue:

ERROR: While executing gem … (Gem::FilePermissionError) You don’t have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

This has come up ever since upgrading to El Capitan and the way Apple changed things that I don’t really understand. You can read about it here, OS X El Capitan screwed up Ruby gems, and how to fix it. Although I didn’t follow the fix (well, at least not today, there is a good chance I did it ages ago!). A search for Ruby and El Capitan will bring up lots of posts about it, it has to do with Apple’s System Integrity Protection (SIP) feature.

Anyway, coming back to todays error. This was following trying to use Rails Composer. Did a google search with the above error and got loads of results. Looked at the first three and came across this Stackoverflow answer, the one about using a Ruby version manager. I knew that it was something to do with my path. Which didn’t have “rbenv” in it even though I was using that. (Actaully it had “.rvm” as I had been using that and thought I had got rid of it all when I made the switch to rbenv!)

So, after sussing out a few things, changed my path in my .zshrc file (note: using zsh not bash!) to:

$HOME/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Making sure I had changed to the ruby version I wanted (rbenv local 2.3.0 – I also changed global to this as well) and then did rbenv rehash (remember to do this step.

Also added this in:

if which rbenv > /dev/null; then eval “$(rbenv init -)”; fi

That is all probably not that helpful, as a lot of it was trial and error. Some good links to keep handy:

https://github.com/rbenv/rbenv

Using rbenv to Manage Rubies and Gems – have only just found this!

This could be useful if you are just starting out – https://gorails.com/setup/osx/10.11-el-capitan.