Skip to content

Instantly share code, notes, and snippets.

View zyqxd's full-sized avatar
⛩️

David Zhang zyqxd

⛩️
  • Square
  • Toronto / Remote
  • X @zyqxd
View GitHub Profile
@zyqxd
zyqxd / advent_of_code_2021.rb
Created December 13, 2021 18:18
Advent Of Code 2021 Day 11, 12, 13
# frozen_string_literal: true
# https://adventofcode.com/2021
module AdvantOfCode2021
URL = 'https://adventofcode.com/2021/day/%d/input'
COOKIE = 'Nope'
def parse_reading(day)
day_url = URL % day
HTTParty.get(day_url, headers: { 'Cookie' => COOKIE }).body.split("\n")
@zyqxd
zyqxd / advent_of_code_2021.rb
Last active December 10, 2021 17:08
Advent Of Code Day 1-10, no edits
# https://adventofcode.com/2021
module AdventOfCode2021
URL = 'https://adventofcode.com/2021/day/%d/input'
COOKIE = 'NOPE'
def parse_reading(day)
day_url = URL % day
HTTParty.get(day_url, headers: { 'Cookie' => COOKIE }).body.split("\n")
end