2020.05.19 - Today I learned how initalize directories and push files to Github.
2020.05.20 - Today I learned how to condense the code in a Class instance with attribute readers, attribute writers, and attribute accessors.
2020.05.20 - Today I learned to simplify hash notation with JSON style.
2020.05.21 - Today I learned how to setup default values in the initialize method with the or operand.
2020.05.21 - I also learned that a block variable can be used in place to iterate through an array.
2020.05.21 - TIL that to pass methods results to other methods, the proper syntax is method_a(argument_for_result)
2020.05.22 - TIL how to parse data from APIs with Ruby
2020.05.25 - TIL how to setup a simple web response with Rails. Web Request, API Route, API Controller, API View, Web Response
2020.05.26 - TIL how to set up a model in Rails
2020.05.26 - TIL that the && operator will not move on if the first statement is false
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enables PostgreSQL interval datatype support (as ActiveSupport::Duration) in Ruby on Rails 4.1. | |
# Based on https://gist.github.com/clarkdave/6529610 | |
require 'active_support/duration' | |
# add a native DB type of :interval | |
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:interval] = { name: 'interval' } | |
# add the interval type to the simplified_type list. because this method is a case statement | |
# we can't inject anything into it, so we create an alias around it so calls to it will call |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).