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
//AOC 1 - 1 | |
temp1.wholeText.split("\n\n").map(txt=>txt.split("\n")).map(arr => arr.map(str=>parseInt(str,10))).map(arr => arr.reduce((sum,a)=>sum+a,0)).sort((a,b)=> a-b)[237] | |
//AOC 1 - 2 | |
temp1.wholeText.split("\n\n").map(txt=>txt.split("\n")).map(arr => arr.map(str=>parseInt(str,10))).map(arr => arr.reduce((sum,a)=>sum+a,0)).sort((a,b)=> a-b).slice(-4).slice(0,3).reduce((sum,a)=>sum+a,0) | |
//AOC 2 - 1 | |
const pts = { 'X':1,'Y':2,'Z':3}; | |
const winCond = { 'AX':3, 'AY':6, 'AZ':0, 'BX':0, 'BY':3, 'BZ':6, 'CX':6, 'CY':0, 'CZ':3 }; | |
temp1.textContent.split("\n").slice(0,-1).map(a=>a.split(" ")).map(round =>{ | |
console.log(round, pts[round[1]] , winCond[round[0]+round[1]]); |
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
class Item { | |
constructor(name, sellIn, quality) { | |
this.name = name; | |
this.sellIn = sellIn; | |
this.quality = quality; | |
} | |
} | |
class Shop { | |
legendaries = ["Sulfuras, Hand of Ragnaros"]; |
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
# docker build -t testfoundry --build-arg FOUNDRY_URL="your url" . | |
FROM node:latest | |
ARG FOUNDRY_URL | |
WORKDIR /home | |
RUN mkdir foundryvtt && mkdir foundrydata && cd foundryvtt && wget -q -O foundryvtt.zip "$FOUNDRY_URL" && unzip -q foundryvtt.zip && rm foundryvtt.zip | |
EXPOSE 30000 | |
ENTRYPOINT node foundryvtt/resources/app/main.js --dataPath=/home/foundrydata |
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 ubuntu | |
ENV APACHE_RUN_USER www-data | |
ENV APACHE_RUN_GROUP www-data | |
ENV APACHE_LOG_DIR /var/web/log/apache2 | |
ENV APACHE_PID_FILE /var/run/apache2.pid | |
ENV APACHE_RUN_DIR /var/run/apache2 | |
ENV APACHE_LOCK_DIR /var/lock/apache2 | |
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get - | |
y -q upgrade && apt-get -y -q install apache2 | |
EXPOSE 80 443 |
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
package com.degineo.server.tools; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.spec.InvalidKeySpecException; | |
import java.util.Arrays; | |
import java.util.Base64; | |
import javax.crypto.SecretKey; | |
import javax.crypto.SecretKeyFactory; | |
import javax.crypto.spec.PBEKeySpec; |