Skip to content

Instantly share code, notes, and snippets.

View fuentesjr's full-sized avatar
:fishsticks:
I may be slow to respond.

Salvador Fuentes Jr fuentesjr

:fishsticks:
I may be slow to respond.
  • GitHub
  • Irvine, CA
  • 18:22 (UTC -07:00)
  • X @fuentesjr
View GitHub Profile
@fuentesjr
fuentesjr / mysql2-mojave.md
Created April 16, 2022 17:06 — forked from zavan/mysql2-monterey.md
Install mysql2 gem on MacOS Big Sur

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Big Sur.

Solution

Make sure openssl is installed on Mac via Homebrew.

@fuentesjr
fuentesjr / taggable.rb
Created September 29, 2020 20:42 — forked from ayrton/taggable.rb
Testing Active Support concerns with rspec in isolation. See first comment for more information.
module Taggable
extend ActiveSupport::Concern
included do
attr_accessible :tags
after_save :set_tags
after_destroy :unset_tags
end
@fuentesjr
fuentesjr / laravel_facades.md
Created June 17, 2020 22:51 — forked from poing/laravel_facades.md
Laravel Facades

Understanding Facades in Laravel

What's a Facade?

The Laravel explination, shown below is confusing.

Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to almost all of Laravel's features. Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.

Many examples use Cache::get('key') to demonstrate how a Facade works. Comparing the following code to the utility that a Facade provides.

#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal