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
(def cost-year | |
(+ | |
14000 ; tuition | |
10000 ; dorm | |
(* 2 2400) ; meal plan | |
)) | |
(* 4 cost-year) |
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
clojure -X:deps mvn-install :jar '"project.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
(ns an.example | |
(:require [clojure.java.shell :as shell] | |
(defn sh-exec [arg-vec] | |
(let [{:keys [exit err]} | |
(shell/with-sh-dir (mk-staging-dir) | |
(apply shell/sh arg-vec))] | |
(when-not (zero? exit) | |
(throw (Exception. err))))) |
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
#!/bin/bash | |
IFS=$'\n' | |
for socket in $(lsof -p 361 | grep IPv | grep -v LISTEN) | |
do | |
IFS=' ' read -r pname pid host fd _ <<< $socket | |
echo "close(${fd%?}) for process $pid" | |
gdb --batch-silent -p $pid --eval-command="call close(${fd%?})" | |
done |
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
#!/bin/sh | |
#_( | |
#_DEPS is same format as deps.edn. Multiline is okay. | |
DEPS=' | |
{:deps {clj-time {:mvn/version "0.14.2"}}} | |
' | |
#_You can put other options here | |
OPTS=' |
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
(defn divisble? | |
"Is `n` divisble by `d`?" | |
{:test (fn [] | |
(is (divisble? 49 7)) | |
(is (not (divisble? 48 7))) | |
(is (divisble? 5 0)))} | |
[n d] | |
(zero? (try (mod n d) | |
(catch Exception _ 0)))) |
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
package | |
receipt.service.persistence | |
import org.springframework.jdbc.core.JdbcTemplate | |
import spock.lang.Specification | |
import javax.sql.DataSource | |
import java.sql.* | |
import java.time.LocalDate |
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
;; :require [clojure.data.xml :as xml] | |
(defn to-xml | |
"Convert an arbitrary map to xml." | |
[root-element x] | |
(xml/emit-str | |
(xml/element | |
root-element {} | |
(map (fn make-node [[f s]] | |
(cond |
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
FROM clojure:tools-deps AS builder | |
ARG VERSION=0.0.0-0-0000000 | |
ENV TZ=America/Chicago | |
RUN mkdir -p /home/builder | |
WORKDIR /home/builder | |
COPY deps.edn /home/builder | |
RUN mkdir resources | |
RUN clojure -Spom |
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
package com.containerstore.order.service | |
import org.joda.time.LocalDate | |
import org.springframework.jdbc.core.JdbcTemplate | |
import spock.lang.Specification | |
import spock.lang.Unroll | |
import javax.sql.DataSource | |
import java.sql.Connection | |
import java.sql.DatabaseMetaData |
NewerOlder