#https://juxt.pro/blog/posts/beanstalk.html
FROM java:8
ADD target/myproj.0.1.0-SNAPSHOT-standalone.jar /srv/myproj-app.jar
EXPOSE 8080
CMD ["java", "-jar", "/srv/myproj-app.jar"]
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
# On host | |
$ cd ~/VirtualBox\ VMs/<vm> | |
$ VBoxManage clonehd "box-disk1.vmdk" "clone-disk1.vdi" --format vdi | |
$ VBoxManage modifyhd "clone-disk1.vdi" --resize 50000 | |
$ VBoxManage storageattach $(pwd | cut -d "/" -f5-) --storagectl "SATA" --port 0 --device 0 --type hdd --medium clone-disk1.vdi | |
# On VM | |
$ vagrant up | |
$ vagrant ssh | |
$ sudo su - |
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
;; https://stuartsierra.com/2016/clojure-how-to-ns.html | |
;; ns cheatsheet https://gist.github.com/ghoseb/287710/ | |
;; Work with library in REPL - example Cheshire | |
(boot.core/set-env! :dependencies #(conj % '[cheshire "5.5.0"])) | |
(require '[cheshire.core]) | |
;; add dependency | |
(set-env! :dependencies #(conj % '[foo/bar "1.2.3"])) |
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
;; Lots of Clojure - http://matthiasnehlsen.com/ | |
; best explanation of apply vs map - http://stackoverflow.com/questions/2311528/clojure-apply-vs-map | |
(apply F [1 2 3 4 5]) | |
;translates to | |
(F 1 2 3 4 5) | |
(map F [1 2 3 4 5]) | |
;translates to | |
[(F 1) (F 2) (F 3) (F 4) (F 5)] |
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
; Blocking | |
>!! ; put | |
<!! ; take | |
; determine Clojure version | |
> *clojure-version* | |
; Look in ~/.m2 to see which Clojure versions are installed. |
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
(boot.core/merge-env! :dependencies '[[org.clojure/java.jdbc "x.y.z"][mysql/mysql-connector-java "x.y.z"]]) | |
(require '[clojure.java.jdbc :as sql]) | |
(def db-host "127.0.0.1") | |
(def db-port 3306) | |
(def db-name "cmdb") | |
(def db-user "root") | |
(def db-password "my-secret-pw") |
https://www.reddit.com/r/Clojure/comments/4j7lyx/docker/
http://www.compoundtheory.com/ - article on Dockerising Clojure
I've been setting up an environment to test out an alternative to CORS for an application I'm developing using Nginx as a reverse proxy in front of three Clojure services. In doing so I needed to setup the backend servers to serve requests. But there was hitch. I was using a Dockerised Nginx which was linking to web service containers. Again, that is working fine.
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
; construct a map, using the keys from one vector, and the values from another | |
(zipmap keys vals) |
ReactRouter.withRouter injects route information into wrapped component props.
render() { const { match, location, history } = this.props
const Component = withRouter(Component)
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
(ns clojure-applied.core) | |
; define a map - values can be looked up in near constant time. | |
(def earth { | |
:name "Earth" | |
:moons 4 | |
:volume 1.083 | |
:mass 5.972 | |
:type :Planet | |
}) |
OlderNewer