Skip to content

Instantly share code, notes, and snippets.

@luisjunco
luisjunco / js-interview-the-rice-and-chessboard-problem.md
Last active February 16, 2025 19:45
JavaScript Interview - The rice and chessboard problem

JavaScript Interview - The rice and chessboard problem


In ancient times, a wise person presented a challenge to a curious king: place 1 grain of rice on the first square of a chessboard, and for each subsequent square, double the number of grains.

For example:

  • 1st square → 1 grain
  • 2nd square → 2 grains
@luisjunco
luisjunco / firebase-rest-api-cheatsheet.md
Last active February 27, 2025 14:41
Firebase REST API cheatsheet

Firebase REST API

This document explains how to configure Firebase as a REST API, as well as some common pain points and tips.


Initial setup

Practice: TypeScript arrays

Intro

  • For this exercise, you can work on your local environment (if you have the TypeScript compiler installed).

  • Or, if you prefer, you can work on an online editor like Stackblitz. For example, you can write your TypeScript code here:

Practice: TypeScript functions

Intro

  • For this exercise, you can work on your local environment (if you have the TypeScript compiler installed).

  • Or, if you prefer, you can work on an online editor like Stackblitz. For example, you can write your TypeScript code here:

PostgreSQL Data Types Cheatsheet

Here's a list with some of the most common data types in PostgreSQL.

Boolean

  • BOOLEAN - a Boolean data type can hold one of three possible values: true, false, or null.

Character Types:

PostgreSQL Example DB

Users Table

CREATE TABLE users (
    user_id SERIAL PRIMARY KEY,

Practice: PostgreSQL setup & first steps

Iteration 1 - Setup:

Follow the instructions in the unit "SQL | Introduction" to install PostgreSQL in your computer (you'll find instructions for each operating system: windows, mac, linux).


Important

Remember the credentials (username and password). \

@luisjunco
luisjunco / lab-react-components.md
Last active March 18, 2025 16:20
LAB React Components

LAB React Components

The main goal of this LAB is to practice creating and rendering React components.


Iteration 1: initial setup

For the initial setup, follow these steps:

JS OOP Bakery exercise

In this exercise, you'll be creating a Bakery class using JavaScript. This class will represent a bakery and have some properties and methods to track the bakery's location, the number of cakes in stock, and the ability to bake cakes.

image