I'm going through the Udemy course Complete Machine Learning and Data Science: Zero to Mastery. The course runs under the flag of Andrei Neagoie. Andrei is a popular instructor on Udemy, with almost 200.000 students, and top reviews. For this course, he has paired up with Daniel Bourke, a self-taught Machine Learning Engineer from Australia. In this blog post series, I will jot down my thoughts on the course, and what I've learned.
kitty is the terminal emulator that I use in conjunction with fish. Kitty is fast, customizable, and has font ligatures. When I start a Vim session from the kitty terminal, Vim looks smooth (I use Victor Mono as my font). If you want to switch kitty's color scheme, you can use kitty @ set-colors –all <path-to-colors-file> to interactively switch colors in your session. I wrote a fish function that uses kitty @ set-colors and sed to switch colors for both kitty and (Neo)Vim.
Today I improved my Nim web application by running the docker container as non=root-user:
base imageFROMnimlang/nim:1.0.4-regular# install dependenciesRUN apt-get update && \ apt-get install -y –no-install-recommends libpq-dev netcat-openbsd# set working directoryWORKDIR/usr/src/app# add userRUN addgroup –system nim && adduser –system –group nimRUN chown -R nim:nim /usr/src/app && chmod -R 755 /usr/src/app# Nim environmentENV NIM_ENV=production ENV NIMBLE_DIR=/home/nim/.nimbleENV PATH=$PATH:/home/nim/.nimble/bin# copy entrypoint, make executableCOPY ./entrypoint.sh .RUN chmod +x entrypoint.sh# install dependencies, bundle assets, compileRUN nimble refresh && nimble install nimassets jesterCOPY .
The Problem Let's say that you create a simple web application with the Nim Heroku Buildpack. Project structure: ├── nim_heroku.nimble ├── Procfile ├── src │ ├── nim_heroku │ ├── nim_heroku.nim │ └── views │ └── general.nim ├── static_dir │ ├── favicon.ico │ └── style.css └── tags 3 directories, 8 files Bin file (src/nim_heroku.nim): import jester, asyncdispatch, os, strutils import views/general var settings = newSettings() if existsEnv("PORT"): settings.port = Port(parseInt(getEnv("PORT"))) settings.staticDir = ".