Skip to content

Instantly share code, notes, and snippets.

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

Salvador Fuentes Jr fuentesjr

🤖
I may be slow to respond.
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.

Keybase proof

I hereby claim:

  • I am fuentesjr on github.
  • I am fuentesjr (https://keybase.io/fuentesjr) on keybase.
  • I have a public key ASDMuUSb2wynEZZvY1dxhwi6yyZfn9Sj9QVh_A8mIy7GRAo

To claim this, I am signing this object:

@fuentesjr
fuentesjr / gc.html
Last active June 27, 2016 14:15
gc_demo
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GC Test</title>
<style>
html { background-color: beige }
</style>
</head>
var _requests = [{
url: '/a.json',
time: 200
}, {
url: '/b.json',
time: 300
}, {
url: '/c.json',
time: 150
}];
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal