Skip to content

Instantly share code, notes, and snippets.

View JudahSan's full-sized avatar
🎯
Focusing

Judah JudahSan

🎯
Focusing
  • Ba sing se
View GitHub Profile
@JudahSan
JudahSan / README.md
Created April 2, 2024 15:41
ActiveStorage::Variant on RoR 7: vips

Problem:

  • The application crashed when attempting to resize the image to a size of 50px x 50px.
  • ActiveStorage was properly configured with the required dependencies.
def image_as_thumbnail
    image.variant(resize_to_limit: [50, 50]).processed
end
@JudahSan
JudahSan / README.md
Last active February 29, 2024 18:58
What is DynamoDB� Is it a typo? This is an into to NoSQL- DynamoDB lab

3 - Create Tables

You will create 4 tables based on JSON format. For that, you will use the DynamoDBManager.create_table method.

To make it easy to access the properties of each of the tables, create the dictionaries that have the following attributes:

  • table_name: Name of the table, composed of a course prefix and the table name.
  • kwargs: Dictionary with additional arguments used in the DynamoDBManager.create_table method.
@JudahSan
JudahSan / README.md
Created January 22, 2024 11:36
Request for Assistance: LHCI Setup Issue in GitHub Actions

Here is the link to the GitHub Actions run where the issue occurred: GitHub Actions Run Link

The specific error message is as follows:

Error: Command exited with code 127
 at ChildProcess.exitListener (/home/runner/.config/yarn/global/node_modules/@lhci/utils/src/child-process-helper.js:51:19)
@JudahSan
JudahSan / README.md
Created January 9, 2024 07:54
ARC repo setup

Africa Ruby Community(ARC) Platform

Introduction

The project aims to build a platform for African Ruby language enthusiasts to connect, share their knowledge and experience, collaborate on projects, and stay up-to-date with the latest developments in the Ruby community, whether they are seasoned developers or beginners just starting out. The platform features a variety of resources, including different chapters for different countries and cities, merchandise, and meetup information. It will also help users get information on online workshops, webinars, and meetups organized by the community, enabling them to learn from experts and network with other enthusiasts.

Project Design: https://still-snowflake-8822.animaapp.io/

Database Design: https://dbdiagram.io/d/62afab7c9921fe2a96397c1e

N.B. Please note that this project is open source, you are therefore encourage to contribute

@JudahSan
JudahSan / db.go
Last active December 23, 2023 13:28
Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work ERROR
package db
import (
"database/sql"
"fmt"
_ "github.com/mattn/go-sqlite3"
)
var DB *sql.DB
@JudahSan
JudahSan / README.md
Created December 19, 2023 17:01
PROXY REVERSE PROXY LOAD BALANCER

Proxy works on Layer 3 while Reverse Proxy works on Layer 7 aka Load Balancer (special type of RP). Proxy generally works on IP and RP works on application layer.

Proxy reroute the port and ip while RP or Load balancer reroute the paths of url example, /image, /getRequest... and so on.

Certainly! Let's break down the concepts of proxy, reverse proxy, and load balancer:

  1. Proxy Server:
@JudahSan
JudahSan / LIGHTHOUSECI.md
Created November 9, 2023 12:29
Instructions on how to setup lighthouse ci

To set up LHCI autorun in your Rails app, you can add the following steps to your Rails CI pipeline:

  1. Install LHCI
  2. Create a LHCI configuration file
  3. Add a step to your CI pipeline that runs LHCI autorun

Install LHCI

npm install lhci
@JudahSan
JudahSan / CDN_S3.md
Created November 7, 2023 17:19
Image Preview and Thumbnail

To add an image upload feature to your Rails application, you can use the popular gem called CarrierWave along with Amazon S3 for storage. CarrierWave allows you to easily handle file uploads in Rails applications.

Here's a step-by-step guide to integrating CarrierWave and Amazon S3 with your Rails app:

Prerequisites:

  1. Set Up an Amazon S3 Bucket:
@JudahSan
JudahSan / README.md
Created October 30, 2023 18:49
How to self host my fullstack projos
@JudahSan
JudahSan / AsychronousJS.md
Last active October 26, 2023 11:44
Node Fundamentals

Asynchronous JavaScript

  • JS is a synchronous, blocking, single-threaded language

  • JS is blocking - no matter how long a previous process takes, the subsequent processes won't kick off until the former is completed

  • Single threaded- a thead is a process that your JS program can use to run a task. Each thread can only do one task at a time. JS has just the one thread called the main thread for executing any code.

  • We need new pices outside JS to help us write asynchronous code.

  • For FE, this where web browsers come into play. For BE, this is where Node.js comes into play

  • Web browsers and Node.js define functions and APIs that allow us to register functions that should not be executed synchronously, and should instead be invoked asynchronously when some kind of event occurs.