Skip to content

Instantly share code, notes, and snippets.

View Chrissiku's full-sized avatar
🎯
Focusing

Chris Siku Chrissiku

🎯
Focusing
View GitHub Profile
# Background:
#after full refactor of the provided code to make it more efficient I added comments to improve readability.
#I'll also address your questions about the 'distinct_groups' variable and what it contains.
start_range = Date.today.beginning_of_month
end_range = Date.today.end_of_month
# Fetch users with the given role efficiently using the database query.

Ruby on Rails API only app | Postgres

01 - Create a new API-only Rails app and setup postgres database

rails new my-app --api --database=postgresql -T

02 - Basic Scaffold

01 - Model

This step is for creating a very basic level of model for us to work in. If you know already, or wish to apply your own custom models with relationships you can skip this step.

@Chrissiku
Chrissiku / example_one.js
Last active June 6, 2022 10:13
Is It DRY ?
const pets = ['Cat', 'Dog', 'Bird', 'Fish', 'Frog', 'Hamster', 'Pig', 'Horse', 'Lion', 'Dragon'];
// Print all pets
console.log(pets[0]);
console.log(pets[1]);
console.log(pets[2]);
console.log(pets[3]);
.cat {
font-family: "Times New Roman", Times, serif;
font-size: 1rem;