Skip to content

Instantly share code, notes, and snippets.

View Goues's full-sized avatar

Jakub Kotrs Goues

  • Socialbakers
  • Prague
View GitHub Profile
@Goues
Goues / 14.js
Created December 14, 2023 06:21
AoC 2023 Day 14
const utils = require('../../utils')
let data = utils.charByLine('./input.txt')
const rotate = (array) => {
let r = Array.from({ length: array.length }, () => [])
for (let y = 0; y < array.length; y++) {
for (let x = 0; x < array[0].length; x++) {
r[y][x] = array[array[0].length - x - 1][y]
}
}
@Goues
Goues / index.ts
Created October 31, 2022 21:16
TS form elements (TS 4.7.2)
interface HTMLFormControlsCollection extends HTMLCollectionBase {
[item: string]: Element | RadioNodeList
}
/*
it gives me:
Property 'item' of type '(index: number) => Element | null' is not assignable to 'string' index type 'Element | RadioNodeList'. ts(2411)
*/