Skip to content

Instantly share code, notes, and snippets.

View nmcolome's full-sized avatar

Natalia Colomé nmcolome

View GitHub Profile
@nmcolome
nmcolome / commit-msg
Created April 27, 2023 00:51 — forked from wesbos/commit-msg
ESLint 3.0 Git Pre Commit Hook
#!/bin/bash
files=$(git diff --cached --name-only | grep '\.jsx\?$')
# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
exit 0
fi
failed=0
for file in ${files}; do
@nmcolome
nmcolome / python_environment_setup.md
Created June 25, 2020 19:16 — forked from wronk/python_environment_setup.md
Setting up your python development environment (with pyenv, virtualenv, and virtualenvwrapper)

Overview of Python Virtual Environments

This guide is targetted at intermediate or expert users who want low-level control over their Python environments.

When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. This helps keep each workflow in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. The guide here covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda). See the Using the workflow section to view the end result.


h/t @sharkinsspatial for linking me to the perfect cartoon

@nmcolome
nmcolome / python_tests_dir_structure.md
Created May 24, 2020 06:07 — forked from tasdikrahman/python_tests_dir_structure.md
Typical Directory structure for python tests

A Typical directory structure for running tests using unittest

Ref : stackoverflow

The best solution in my opinion is to use the unittest [command line interface][1] which will add the directory to the sys.path so you don't have to (done in the TestLoader class).

For example for a directory structure like this:

new_project

├── antigravity.py

@nmcolome
nmcolome / pre-mod-4-reflection.md
Last active August 7, 2017 18:17 — forked from case-eee/pre-mod-4-reflection.md
These are reflection questions for students entering backend module 4.

M4 Reflection

Fork this gist and answer these questions to reflect on your learning experiences.

  • What brought you to Turing?

I wanted to change into a career that would allow me to have different challenges constantly, where I could problem solve and build solutions for others in an efficient way. I chose Turing because in my experience, it's not just about how good you are, it's also about how well you work with others and I was really happy to see that Turing is focused on not just teaching you to code, but to be part of a community and to collaborate with others (which I believe it's the most important factor in any job).

  • Where do you see yourself after Turing?

Week One - Module 3 Recap

Fork this respository. Answer the questions to the best of your ability. Try to answer them with limited amount of external research. These questions cover the majority of what we've learned this week (which is a TON!).

Note: When you're done, submit a PR.

  1. What is json, what does it stand for, and why is it important?
  2. What kind of object is JSON in Ruby? How do we know it's JSON?
  3. What's the difference between joins and includes in ActiveRecord?
  4. What's an API?
@nmcolome
nmcolome / rails_setup.markdown
Created July 15, 2017 22:57 — forked from NicholasJacques/rails_setup.markdown
Getting Started with RSpec and Rails:

Getting Started with RSpec and Rails:

Setting up a new Ruby on Rails project using RSpec, Cabybara, FactoryGirl and DatabaseCleaner

What will this tutorial do you for you?

This tutorial will help guide you through the process of setting up a new Ruby on Rails project with robust testing capabilities. This tutorial makes a couple of assumptions:

  • You have installed Ruby on Rails and have a rudimentary understanding of how to use it.
  • You have installed bundler
@nmcolome
nmcolome / friendly_urls.markdown
Created June 3, 2017 03:38 — forked from jcasimir/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@nmcolome
nmcolome / warm-up.markdown
Last active May 24, 2017 15:31 — forked from case-eee/warm-up.markdown
Authentication Warm Up

Fork this gist and answer the following questions.

  • What's the difference between Authentication and Authorization?

Authentication is to verify that the user is who he says he is; Authorization is to validate if the user can access certain paths/actions or not (what do you have privilege to).

  • Why are both necessary for securing our applications?

They are both needed because they validate different things inside an application, so we want the right people to access the right information.

Part I: User Creation

  1. add route for new_user_path
  2. create a UsersController with new action
  3. create new.html.erb
  4. generate user model with password_digest string field
  5. uncomment gem 'bcrypt' in Gemfile and add has_secure_password in User model
  6. add create action in UsersController
  7. implement logic for creating a user
  8. set session[:user_id] in create action