Skip to content

Instantly share code, notes, and snippets.

View DeepSnowNeeL's full-sized avatar
🏠
Working from home

Cruz Maximilien DeepSnowNeeL

🏠
Working from home
View GitHub Profile
@DeepSnowNeeL
DeepSnowNeeL / sol.js
Last active December 3, 2022 09:47
Advent Of Code 2022 - shitty solutions 🤮
//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]]);
class Item {
constructor(name, sellIn, quality) {
this.name = name;
this.sellIn = sellIn;
this.quality = quality;
}
}
class Shop {
legendaries = ["Sulfuras, Hand of Ragnaros"];
@DeepSnowNeeL
DeepSnowNeeL / Dockerfile
Created January 27, 2022 12:10
Foundry VTT dockerized + traefik
# 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
@DeepSnowNeeL
DeepSnowNeeL / Dockerfile
Created October 19, 2020 09:09
Simple Dockerfile for workshop
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
@DeepSnowNeeL
DeepSnowNeeL / TestAuth.java
Last active March 20, 2024 22:37
java version of C# identity hashing method (password version 3)
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;