Skip to content

Instantly share code, notes, and snippets.

View cdrani's full-sized avatar
🎯
Focusing

charles cdrani

🎯
Focusing
View GitHub Profile
@cdrani
cdrani / mysql-setup.md
Last active February 4, 2023 20:41
MySQL Setup

Set up and configure our DBMS of choice, MYSQL, to store and manage data. Additionally setup user credentials validation and reset MySQL default users, databases, etc.

sudo apt install -y mysql-server

After installation, it's recommended to purge some insecure default settings and lock down access to the database system. The first thing we should do is set a password for the root password (using mysql_native_password as our default authentication method**)** as by default it has none - a huge security risk.

@cdrani
cdrani / facebook_business.rb
Last active July 6, 2022 15:45
Facebook Business
module Facebook
class EventHandler
def call(record:, request_params:, type:)
@record = record
@request_params = request_params
@facebook_pixel_id = Rails.configuration.analytics_facebook_pixel_id
send_event(type)
end
private
@cdrani
cdrani / rspec_guard_setup.md
Last active September 17, 2018 22:37
Simple RSpec With Guard Setup
  1. Create a starting directory and enter it

    mkdir test_setup && cd test_setup

  2. Create a Gemfile inside of test_setup

  3. Enter the following gems into your Gemfile:

    source "https://rubygems.org"

gem 'rspec'

@vasanthk
vasanthk / System Design.md
Last active May 31, 2024 01:39
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@jendiamond
jendiamond / gist:6128723
Last active April 11, 2024 11:35
Creating your own Gem & Command Line Interface Using Bundler

Presentation slides

Create a Gem - Make it a CLI - Add Rspec Tests

Create a Gem - Make it a Command Line Interface - Add Rspec Tests Using Bundler & Thor

#Creating your own Gem

  1. Run this command in your Terminal. This creates and names all the files you need for your gem. We are going to create a Lorem Ipsum Generator; you can call it whatever you want but seeing as we are creating a Lorem Ipsum generator we'll call it lorem. Read about gem naming conventions.