# Bootstrapping OpenBSD

The best way to install clojure is to install it with pkg_add command and don't forget to install jdk (java developer kit)

pkg_add clojure jdk

We can now edit ~/.profile to add some specific global variables

export JAVA_HOME=/usr/local/jdk-1.8.0
export PATH=${PATH}:${JAVA_HOME}/bin:~/bin

java and other command can know be invoked through the shell. We now need to install leiningen

mkdir ~/bin && cd ~/bin
ftp https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
chmod a+x lein
lein

# Creating a new project with leiningen

Before doing something, you will need to create a new project by using lein command:

lein new luminus my-project

# Add new dependencies

Edit project.clj file and add some dependencies to manage sqlite database

[org.xerial/sqlite-jdbc "3.7.2"]
[org.clojure/java.jdbc "0.7.9"]
[com.layerware/hugsql "0.4.9"]

# Execute the REPL

lein repl

# Reloading a file

(use 'social-network-survey.db :reload)

# Resources

  • https://leiningen.org/
  • https://stackoverflow.com/questions/7658981/how-to-reload-a-clojure-file-in-repl
  • https://grishaev.me/en/clj-sqlite/
  • https://github.com/krisajenkins/yesql
  • http://www.luminusweb.net/docs
  • https://www.hugsql.org/
  • https://stackoverflow.com/questions/20466132/how-do-i-recompile-and-reload-java-source-code-while-lein-repl-is-running
  • https://github.com/bhauman/lein-figwheel
  • https://www.compose.com/articles/embrace-sql-with-hugsql-clojure-and-postgresql

# Videos

  • https://www.youtube.com/watch?v=3Xm_nVqxowk
  • https://www.youtube.com/watch?v=LcpbBth7FaQ
  • https://www.youtube.com/watch?v=oOON--g1PyU
  • https://www.youtube.com/watch?v=alkcjyhesjI
  • https://www.youtube.com/watch?v=Cym4TZwTCNU
  • https://www.youtube.com/watch?v=wR2kYn-7ijQ