Skip to content

Instantly share code, notes, and snippets.

View mvoto's full-sized avatar

Mauricio Voto mvoto

  • Port Coquitlam, BC
View GitHub Profile
@mvoto
mvoto / gist:3d17d1bdcf1f2291a44a
Created April 16, 2015 19:56
dockerfile: base: ubuntu + nginx, rbenv and ruby 2.2.1
# Ubuntu as the base image
FROM ubuntu:trusty
# Install core tools
RUN apt-get -y update
RUN apt-get -y install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
# Install nginx
RUN apt-get -y install curl nginx
RAILS_ENV=production rake db:setup
# produces the error below.....hmmm.....it's a no-worky
psql:/yourprojectpath/yourproject/db/structure.sql:29: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory
# hstore postgresql extension needs to be installed, so....
sudo apt-get install postgresql-contrib
# now your extension should be available to enable so log in with psql
psql -d yourproject_production -U yourdbuser -W
@mvoto
mvoto / gist:3866cc1c137f533647ef
Created September 26, 2014 13:52
git_ignore_global
[user]
name = Mauricio Voto
email = mauriciovoto@gmail.com
[core]
excludesfile = /Users/mvoto/.gitignore_global
editor = /usr/bin/vim
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
@mvoto
mvoto / gist:2a7ff1b6682b279764c6
Created July 29, 2014 13:28
Rails Active Record + Querying References
- Basic Guides(awesome reference):
http://guides.rubyonrails.org/active_record_querying.html
http://guides.rubyonrails.org/active_record_basics.html
- Short Screencast:
http://railscasts.com/episodes/202-active-record-queries-in-rails-3
- More complete guide:
http://www.theodinproject.com/ruby-on-rails#section-advanced-forms-and-active-record
http://www.theodinproject.com/ruby-on-rails/active-record-queries
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@mvoto
mvoto / gist:8460852
Created January 16, 2014 18:43 — forked from ryansobol/gist:5252653
15 Ruby questions

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@mvoto
mvoto / metaprog blog post
Last active December 28, 2015 22:19
This is an initial draft for a blog post
Metaprogramming is not a monster
- Intro:
Every ruby developer should have heard about this topic and 8 from 10 just get scared, probably.
We know that "procs", "lambdas" and "yield" are metaprogramming magic, but there is much more about this 'magic self generating code' land.
I don't want to dive deep into this topic here, just going to talk a little about a daily experience that I've faced and could learn a lot and
be satisfied with metaprogramming, and yes, I figured out that metaprogrammin is not a monster.
- The problem:
We are currently keeping registers on database instead of destroying it, but not all the models and the project also has some dependent destroy associations that behaves this way.
@mvoto
mvoto / gist:6226235
Last active December 21, 2015 01:18
Sublime Text User Prefs
{
"theme": "Material-Theme-Darker.sublime-theme",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
// "theme": "SoDaReloaded.sublime-theme",
// "color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
// For Material theme improvement
"overlay_scroll_bars": "enabled",
"line_padding_top": 1,
"line_padding_bottom": 1,
"font_options": [ "gray_antialias" ], // On retina Mac
@mvoto
mvoto / gist:6159939
Last active December 20, 2015 16:09
Notas para Apresentações
1 - Criação - desenvolver raciocínios argumentos
2 - Estilo - Como vai apresentar/mostrar essa ideia - argumentos
3 - Organização - Como montar o que vc vai expor(linha de tempo)
4 - Memória - vc saber o q vai falar sem precisar olhar
5 - Ação - como vc vai apresentar, tom de voz, maneira de se portar, etc
@mvoto
mvoto / gist:6092568
Last active December 20, 2015 07:19
Building Software vs Programming
1/2 - Who are you ???
We all know that developers are smart people. We just think quickly and try to reproduce it at the same time.
But it is important to keep in mind that we need to work on a few skills to be even more smart. Sometimes we forgot a few things when we are in our quick coding travel.
This talk is about skills that makes software artists different from lines of code makers.
3 - Building Software
Developers must be good at designing discussing and thinking about a problem, so they can try to find a better solution for that.
Programmers don't need tests for example, this is just a waste of time, they could just write more code if they are not writing tests.