Skip to content

Instantly share code, notes, and snippets.

View dedemenezes's full-sized avatar

André Menezes dedemenezes

View GitHub Profile

diff --git a/app/controllers/programs_controller.rb b/app/controllers/programs_controller.rb index 7138183..274e01c 100644 --- a/app/controllers/programs_controller.rb +++ b/app/controllers/programs_controller.rb @@ -1,8 +1,6 @@ class ProgramsController < ApplicationController

  • DATES_PER_PAGE = 1
  • include Pagy::Backend

def index

Examples:

  • Wott
    • A user uploads a coding challenge
    • Then chats with AI to help them solve coding challenges@c
  • Travel Assistant
    • User enters their trip destination + dates.
    • Then chats with AI to suggest a daily itinerary, restaurants, activities, and transport tips.
  • Book Recommendation
  • A user saves their book readings
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 50e8193..028a8a6 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,9 +1,11 @@
# Task
+
<!-- Please add link(s) to Jira task(s) related to this PR -->
A link to a task in Jira or an issus on Github
def parse_url(url)
# p url
regex = /^(?<scheme>https?):\/{2}(?<subdomain>w{3})\.(?<domain>\w+)(?<top_level_domain>\.\w+)\/?(?<path>[\w\/]+)\??(?<query_params>[&=\w]*)/
match_data = url.match(regex)
# p match_data
#<MatchData "http://www.lewagon.com" scheme:"http" subdomain:"www" domain:"lewagon" top_level_domain:".com">
query_params = match_data[:query_params].scan(/(\w+)=(\w+)/)
# p query_params #=> [["search", "currywurst"]]
params = {}
query_params.each do |param|
def parse_url(url)
# p url
regex = /^(?<scheme>https?):\/{2}(?<subdomain>w{3})\.(?<domain>\w+)(?<top_level_domain>\.\w+)\/?(?<path>[\w\/]+)\??(?<query_params>[&=\w]*)/
match_data = url.match(regex)
# p match_data
#<MatchData "http://www.lewagon.com" scheme:"http" subdomain:"www" domain:"lewagon" top_level_domain:".com">
query_params = match_data[:query_params].scan(/(\w+)=(\w+)/)
# p query_params #=> [["search", "currywurst"]]
params = {}
query_params.each do |param|
def parse_url(url)
# p url
regex = /^(?<scheme>https?):\/{2}(?<subdomain>w{3})\.(?<domain>\w+)(?<top_level_domain>\.\w+)\/?(?<path>[\w\/]+)\??(?<query_params>[&=\w]*)/
match_data = url.match(regex)
# p match_data
#<MatchData "http://www.lewagon.com" scheme:"http" subdomain:"www" domain:"lewagon" top_level_domain:".com">
query_params = match_data[:query_params].scan(/(\w+)=(\w+)/)
# p query_params #=> [["search", "currywurst"]]
params = {}
query_params.each do |param|
import { Controller } from "@hotwired/stimulus";
export default class extends Controller {
// AS SOON AS THE data-controller appears in the page
static targets = ['giftName', 'giftPrice', 'listItems', 'suggestionList', 'searchInput']
connect() {
console.log(this.giftNameTarget);
console.log(this.giftPriceTarget);
console.log(this.listItemsTarget);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Background and Objectives

Today we will build a Christmas list, just like you did back in the Intro to Ruby module, but this time it'll have a real front-end!

We will be creating a form via which we can upload gifts to our list. We will also be using an API to get gift ideas we can add to our list.

The Bootstrap stylesheet is already linked in the index.html file for you so feel free to use their pre-made classes or have a go at making your own in style.css!

Note: there will be no rake for this challenge! To see if your page is working, you'll have to test it out yourself in the browser.

puts 'Welcome to Chritmas Gift List'
user_input = nil
gift_list = [{ name: 'Laptop', status: false }, { name: 'Flamengo Shirt', status: false }]
# indexes 0 1
while user_input != 'quit'
# 1. Give the user a new option (MARK)
puts 'Which action [list|add|delete|mark|quit]?'