_about-me
//
personal-info
bio
// Code snippet showcase:
; returns the value of the char in the hash
(defn find-char-in-hash [charToFind hashValues]
(let [s (str charToFind)]
(if (or (and (> (int charToFind) 96) (< (int charToFind) 123)) (or (= (int charToFind) 32)(= (int charToFind) 10)))
(if (= charToFind \newline) -2
(if (false? (clojure.string/blank? s)) ; if false then char is an actual value
(index-of hashValues charToFind) -1)) ; if not found return -1
charToFind))) ; if not return special character
; hashes the number
(defn hash-char-number [character]
(let [hashFile (slurp file-to-hash-from)]
(let [charNum (find-char-in-hash character hashFile)]
(if (false? (char? charNum))
(if (> charNum 0)
(mod (+ charNum 13) 26)charNum) ; return hashed num
charNum)))) ; else return the original value
; hashes the character
(defn hash-char [hashedCharNumber]
(let [hashValues (slurp file-to-hash-from)]
(if (false? (char? hashedCharNumber))
(if (false? (= hashedCharNumber -2)) ; if not newline
(if (false? (= hashedCharNumber -1)) ; value 12 is space
(get hashValues hashedCharNumber) " ") \newline)hashedCharNumber)))
(defn clear-hashed-file [file] (with-open [w (clojure.java.io/writer file :append false)] ; will overwrite values already in file
(.write w (str ""))))
; writes output to new file
(defn hash-file [hashedPhrase]
(with-open [w (clojure.java.io/writer file-to-write-hash-to :append true)] ; will append to values already in file
(.write w (str hashedPhrase))))
; reads file line by line
(defn read-file-line-hash []
(clear-hashed-file file-to-write-hash-to) ; empties out all contents of file FOR NEW HASH
(with-open [r (clojure.java.io/reader file-to-hash)]
(doseq [line (line-seq r)]
(let [newLineToHash (lower-case (str (clojure.string/replace line #"\newline" " ") \newline))]
(loop [i 0 result []]
(if (<= i (- (count newLineToHash) 1))
(recur (+ i 1) (conj result (hash-char (hash-char-number (get newLineToHash i)))))
(hash-file (apply str result)))))))
(slurp file-to-write-hash-to)) ; returns new hashed file
class MagicMirrorItem(settings: Settings?) : Item(settings) {
override fun use(world: World?, playerEntity: PlayerEntity, hand: Hand?): TypedActionResult<ItemStack?>? {
playerEntity.teleport(-1300.0, 70.0, 1000.0)
playerEntity.playSound(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0F, 1.0F)
return TypedActionResult.success(playerEntity.getStackInHand(hand))
}
}
invstore:
image: bsimmons12/invstore:latest
restart: always
container_name: invstore
depends_on:
mysql:
condition: service_healthy
ports:
- "5000:5000" # Adjust port as needed
environment:
- PORT=5000 # Set the port for NGINX to use
- DATABASE_URL=mysql+mysqlconnector://root:password@mysql-db-flask:3306/invstore # Use the assigned value
- SECRET_KEY=unique_key # Use the assigned value
networks:
- web-network