Skip to content

Instantly share code, notes, and snippets.

View cloudrac3r's full-sized avatar
🏳️‍🌈
nonbinary! they/them

Cadence Ember cloudrac3r

🏳️‍🌈
nonbinary! they/them
View GitHub Profile
@cloudrac3r
cloudrac3r / methods.js
Created December 5, 2019 05:58
Advent of Code 2019 day 5 solution (both parts)
// @ts-check
const {read} = require("../util/read")
const outputQueue = []
const stdinQueue = []
function dataReceiver(data) {
const value = +data.toString()
if (stdinQueue.length) stdinQueue.shift()(value)
@cloudrac3r
cloudrac3r / methods.js
Last active December 8, 2019 05:25
Advent of Code 2019 day 6 solution (both parts)
const {read} = require("../util/read")
class SpaceJunk {
constructor(name) {
this.name = name
/** @type {SpaceJunk} */
this.parent = null
this.children = []
}
@cloudrac3r
cloudrac3r / methods.js
Created December 8, 2019 05:25
Advent of Code 2019 day 8 solution (both parts)
const {read} = require("../util/read")
class SpaceImage {
constructor(width, height) {
this.width = width
this.height = height
this.layers = []
}
importPixels(pixels) {
@cloudrac3r
cloudrac3r / methods.js
Created December 8, 2019 07:06
Advent of Code 2019 day 7 part 2
// @ts-check
const {read} = require("../util/read")
const {permute} = require("../util/mult")
const {EventEmitter} = require("events")
class Connection extends EventEmitter {
constructor() {
super()
this.buffer = []