This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const chroma = require("chroma-js"); | |
const fs = require("fs-extra"); | |
const app = express(); | |
const scaleGood = chroma.scale(["blue", "green"]); | |
const scaleOk = chroma.scale(["yellow", "orange"]); | |
const scaleBad = chroma.scale(["red", "black"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generate(host, path) { | |
let out = ""; | |
// let outscript = ` | |
// <img src='no' onerror='eval(" | |
// function fetch(url, cb) { | |
// var xhr = new XMLHttpRequest(); | |
// xhr.open(\\"GET\\", url); | |
// xhr.send(); | |
// xhr.onerror = function(err) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Socket } from "net"; | |
import * as readline from "readline"; | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
function wait() { | |
return new Promise<string>((resolve) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# input | |
lo = 372037 | |
hi = 905157 | |
ans = 0 | |
def test(s): | |
c = 0 | |
d = 0 | |
for i in range(5): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# partial solution (intcode stuff cut out, but it should hopefully be clear what everything does) | |
# proc = (intcode program instance constructed from input) | |
mp = dict() | |
EMPTY = 0 | |
WALL = 1 | |
BLOCK = 2 | |
PADDLE = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open("input.txt") as f: | |
inp = list(map(int, f.read()[::])) | |
def do_phase(lst): | |
return [do_comp(lst, i) for i in range(len(lst))] | |
def get_mult(n, m): | |
m += 1 | |
m %= 4 * n | |
if m < n: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# intcode interpreter omitted | |
def go(): | |
p = make_process(inp) | |
p = start(p) | |
while p[0] != DONE: | |
if p[0] == INPUT: | |
i = input() | |
for c in i: | |
p = inpt(p, ord(c)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ nc another-universe.chal.ctf.westerns.tokyo 80 | |
GET /(primary:debug/answer) HTTP/1.1 | |
Host: another-universe.chal.ctf.westerns.tokyo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from advent import Input | |
import re | |
input = Input(day = 4).lines() | |
ans = 0 | |
keys = set() | |
for ln in input: | |
if ln == "": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
from collections import defaultdict | |
from os import path | |
from typing import DefaultDict, List, NamedTuple, Optional, Sequence, Set, Tuple, cast | |
import requests | |
import re | |
from copy import copy | |
from pyrsistent import m, s, v, PMap, PSet, PVector |
OlderNewer