Skip to content

Instantly share code, notes, and snippets.

View Chrissiku's full-sized avatar

Chris Siku Chrissiku

View GitHub Profile
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
.cat {
font-family: "Times New Roman", Times, serif;
font-size: 1rem;

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.

# 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 =
end_range =
# Fetch users with the given role efficiently using the database query.