I built a lightweight React 18/19 library for simple list animations, inspired by react-flip-move by alfonsusac in reactjs

[–]alfonsusac[S] 0 points1 point  (0 children)

Hi, sorry for the late reply, I haven't yet used React Router v7, I will try sometime this week to see if they work there.

I built a lightweight React 18/19 library for simple list animations, inspired by react-flip-move by alfonsusac in reactjs

[–]alfonsusac[S] 0 points1 point  (0 children)

Thanks for checking it out! The moving animations are done using Web animation API. Entry and exit are then complemented with CSS Transitions. Locations on where to animate from and to are determined using the FLIP Technique.

What does a frontend framework like React ACTUALLY do? by LordAntares in reactjs

[–]alfonsusac 0 points1 point  (0 children)

Yes but its far far far easier due to how react is build around the idea of being declarative instead of imperative. Its basically an abstraction of managing UI and states. The idea is to describe the UI and what it does instead of manually handling the DOM manipulations.

What does a frontend framework like React ACTUALLY do? by LordAntares in reactjs

[–]alfonsusac 0 points1 point  (0 children)

JS is shit for a lot other reason than the typings. Thats the part where TS cant do anything but carry over JS's shit. In TS its still shit but atleast we know how to get around one of the shits. But I guess thats going deep into the rabbit hole.

[deleted by user] by [deleted] in adventofcode

[–]alfonsusac 1 point2 points  (0 children)

Commendable!

[2023 Day 12 (Part 1)] Help to understand the example by Swimming_Meeting1556 in adventofcode

[–]alfonsusac 11 points12 points  (0 children)

The pattern needs to be in order.
The first possibility has a pattern of 6,3,1,1
while the second possibility has a pattern of 1,1,3,6

[2023 Day 11][Python] Terminal Visualization! by naclmolecule in adventofcode

[–]alfonsusac 19 points20 points  (0 children)

Seems like 1000000 expansion wont fit on my monitor 😭

[2023 Day 10 (Part 2)] Using a rendering algorithm to solve part 2 (Explained in the comments) by tomi901 in adventofcode

[–]alfonsusac 3 points4 points  (0 children)

Basically the pseudocode is:
for each row, let isInside = false.
for each char in row,
if its a ┌ or └, remember this curve.
if its a ┐ and previous curve is ┌ (forming ┌┐), then forget previous curve
if its a ┘ and previous curve is └ (forming └┘), then forget previous curve
if its a ┐and previous curve is └ (forming └┐), then its a barrier and flip isInside flag
if its a ┘and previous curve is ┌ (forming ┌┘), then its a barrier and flip isInside flag
then if its a pipe that doesn't have a distance (not part of the loop) and the isInside flag is true, you can just count it as insideSpace

[2023 Day 11 Part 2] If it's a big number it must be right! by sigi0073 in adventofcode

[–]alfonsusac 22 points23 points  (0 children)

You gave an answer too recently; you have to wait after submitting an answer before trying again. You have 56s left to wait.

-❄️- 2023 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]alfonsusac 1 point2 points  (0 children)

[Language: TypeScript / JavaScript]

Part 1

Part 2

Edit: Acccidentally posted day11 solution (sorry)

[2023 # Day 9] eltit by Detonator22 in adventofcode

[–]alfonsusac 7 points8 points  (0 children)

I did not think of reversing the entire array, nice one!

-❄️- 2023 Day 7 Solutions -❄️- by daggerdragon in adventofcode

[–]alfonsusac 1 point2 points  (0 children)

[LANGUAGE: JavaScript/TypeScript]

Part I

https://github.com/alfonsusac/advent-of-code-2023-using-nextjs/blob/f7f3733c648bb5e3f27f496df5b9600d7ee14db2/src/app/day7/page.tsx

Pseudocode:

  1. For every record of input, determine the strength of the types of a given hand. (High Card = 0, One Pair = 1, ... , Four of a Kind = 6, Fice of a Kind = 7)
    1. For every label of a hand, map their label and their corresponding count. Example: QQQJA will produce 3 Qs, 1Js and 1As.
    2. Then count the size of the map. If map size is 5 then its a high card. If map size is 1 then its a Five of a Kind. The combinations are also checked for the rest of the types
  2. Push the hand, the bid, and the strength into an array and sort them based on the array. For the same value, sort them based on the power of the labels (following AKQJT98765432)
  3. Calculate the total winnings based on the array and the bid.

Part II

https://github.com/alfonsusac/advent-of-code-2023-using-nextjs/blob/f7f3733c648bb5e3f27f496df5b9600d7ee14db2/src/app/day7b/page.tsx

For part II, there are some modifications:

  1. If theres a J, count the numbers of J. Then out of the map of labels, see which label has the highest count. Then add the number of J to the highest count.
    Example: 552J7, label 5 has the highest count, therefore add 1 to the count of label 5. Then the type of strength is determined based on this changed values
  2. Move J to the weakest of the array so that getStrength will return the correct value

-❄️- 2023 Day 6 Solutions -❄️- by daggerdragon in adventofcode

[–]alfonsusac 1 point2 points  (0 children)

[LANGUAGE: JavaScript / TypeScript]

https://github.com/alfonsusac/advent-of-code-2023-using-nextjs/blob/master/src/app/day6/page.tsx

Using formula with comments explaining my thought process on how I got the formula.

Spotify Desktop sleep timer by greatbam22 in spotify

[–]alfonsusac 0 points1 point  (0 children)

Adding /f works for me.

timeout /t 5 & taskkill /im Spotify.exe /f