Skip to content

Instantly share code, notes, and snippets.

View anchietajunior's full-sized avatar
💭
Working Hard

José Anchieta anchietajunior

💭
Working Hard
View GitHub Profile
@anchietajunior
anchietajunior / railsconf.md
Created July 12, 2024 21:06
RailsConf 2024 (Detroit)
@anchietajunior
anchietajunior / paint_bucket.rb
Created November 20, 2023 10:53
Implementing MS-Paint's “paint bucket”
def flood_fill(image, x, y, new_color)
target_color = image[x][y]
fill(image, x, y, target_color, new_color)
end
def fill(image, x, y, target_color, new_color)
return if x < 0 || x >= image.length || y < 0 || y >= image[0].length
return if image[x][y] != target_color
return if image[x][y] == new_color
@anchietajunior
anchietajunior / suppliers.sql
Created November 20, 2023 10:51
Query suppliers in “VITORIA” that provide “MOTOR” for “KOMBI”,
-- Create database structure
CREATE TABLE SUPPLIER (
SUPPLIER_CODE VARCHAR(255),
SUPPLIER_NAME VARCHAR(255),
CITY VARCHAR(255)
);
CREATE TABLE PART (
PART_CODE VARCHAR(255),
NAME_PART VARCHAR(255),
@anchietajunior
anchietajunior / phone_search.rb
Created November 20, 2023 10:48
Search a person number in a list given a person name
def search_phone_by_name(list, name)
left = 0
right = list.length - 1
while left <= right
mid = (left + right) / 2
current_name = list[mid][:name]
if current_name == name
return list[mid][:phone]
@anchietajunior
anchietajunior / palindrome.rb
Created November 20, 2023 10:46
Palindrome algorithm
def palindrome?(word)
left = 0
right = word.length - 1
while left < right
return false if word[left] != word[right]
left += 1
right -= 1
end
centre_id brand center_status address_line1 address_line2 address_line3 city state_or_province zip_or_postal_code country_iso_code longitude latitude address_number building_name street_name floor_numbers suite_numbers unit_numbers product_category product_name building_description local_area_description total_building_size area_size_unit min_desks max_desks centre_open_date min_term max_term min_cost max_cost currency featured_image external_building_image high_res_images high_res_image_tags low_res_images low_res_image_tags feature_24_hour_access feature_24_hour_cctv_monitoring feature_airport_location feature_bicycle_storage feature_breakout_areas feature_business_park_location feature_city_town_centre feature_day_care feature_disabled_facilities feature_double_glazing feature_elevator feature_gym_and_fitness_room feature_lounge_area feature_major_transport_links feature_meeting_rooms feature_on_site_dry_cleaning feature_on_site_lunch_restaurant feature_outside_seating_area_terrace feature_parking feature_
centre_id brand center_status address_line1 address_line2 address_line3 city state_or_province zip_or_postal_code country_iso_code longitude latitude address_number building_name street_name floor_numbers suite_numbers unit_numbers product_category product_name building_description local_area_description total_building_size area_size_unit min_desks max_desks centre_open_date min_term max_term min_cost max_cost currency featured_image external_building_image high_res_images high_res_image_tags low_res_images low_res_image_tags feature_24_hour_access feature_24_hour_cctv_monitoring feature_airport_location feature_bicycle_storage feature_breakout_areas feature_business_park_location feature_city_town_centre feature_day_care feature_disabled_facilities feature_double_glazing feature_elevator feature_gym_and_fitness_room feature_lounge_area feature_major_transport_links feature_meeting_rooms feature_on_site_dry_cleaning feature_on_site_lunch_restaurant feature_outside_seating_area_terrace feature_parking feature_

Mutations

Create user and return user data with JWT

mutation {
  createUserForMobile(
    input: {
      name: "Santo Agostinho",
      email: "santoagostinho202118930823910@gmail.com",
@anchietajunior
anchietajunior / template_diferente.md
Last active February 22, 2022 20:06
PR Template Diferente

Descrição

Esse Pull Request tem a intenção de ... (descrição completa).

Card do Jyra

Imagens (caso necessário)

Radouken

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname