I hereby claim:
- I am bartojs on github.
- I am bartojs (https://keybase.io/bartojs) on keybase.
- I have a public key whose fingerprint is 968F 927F 138D 6A70 21FA 8BA7 3198 8EC7 8631 3EC7
To claim this, I am signing this object:
(deftask fmt | |
"fmt file or dir using cljfmt (changes files)" | |
[f files VAL str "file(s) to format"] | |
(set-env! :dependencies '[[cljfmt "0.3.0"]]) | |
(require 'cljfmt.core | |
'clojure.java.io) | |
(let [reformat-string (resolve 'cljfmt.core/reformat-string) | |
file (resolve 'clojure.java.io/file) | |
fmt-file (fn [f] | |
(println "formatting" (.getName f)) |
;; 1) first goto https://console.developers.google.com/start/api?id=gmail | |
;; -- to turn on gmail api for your account | |
;; 2) then create a oauth consent with app name | |
;; 3) then add oauth clientid and download to ./clientsecret.json | |
;; 4) boot run | |
;; -- when running first time a browser will open to accept authorizaton | |
(set-env! :dependencies '[[com.google.apis/google-api-services-gmail "v1-rev34-1.21.0"] | |
[com.google.api-client/google-api-client "1.20.0"] | |
[com.google.oauth-client/google-oauth-client-jetty "1.20.0"]]) |
;; boot fmt -f myfile.clj | |
;; boot fmt -f src | |
;; -- it will change files inplace | |
(set-env! :dependencies '[[cljfmt "0.3.0"]]) | |
(require '[cljfmt.core :as fmt] | |
'[clojure.java.io :as io]) | |
(defn fmt-file [f] |
;; 1) download this build.boot file | |
;; 2) download & install http://boot-clj.com | |
;; 3) cp ~/.ssh/id_rsa.pub authorized_keys | |
;; 4) boot run | |
;; -- this will run the server for a minute on port 2222 | |
;; 5) test with scp -v -i ~/.ssh/id_rsa -P 2222 mytestfile-original.txt localhost:mytestfile-transferred.txt | |
;; 6) check scp output for which keys are sent - remember to check if ssh-agent is running (which will cache keys) | |
(set-env! :dependencies '[[org.apache.sshd/sshd-core "0.9.0"] | |
[org.apache.sshd/sshd-sftp "0.9.0"]]) |
;; add to build.boot to generate project.clj for cursiveclojure | |
;; adds clojurescript if boot-cljs is used | |
(deftask lein [] | |
(let [coords [(symbol (or (get-env :project) "boot-project")) (or (get-env :version) "0.1.0-SNAPSHOT")] | |
proj (into {} (keep #(if-let [x (get-env %)] [% x]) | |
[:url :licence :description :dependencies])) | |
cljs? (.matches (pr-str (:dependencies proj)) ".*adzerk/boot-cljs .*") | |
projcljs (update-in proj [:dependencies] conj '[org.clojure/clojurescript "1.7.170"])] | |
(spit "project.clj" (cons 'defproject (apply concat coords (if cljs? projcljs proj)))))) |
build: | |
GOPATH=`pwd` GOOS=windows GOARCH=amd64 go get -u -f github.com/influxdb/influxdb/cmd/influxd | |
GOPATH=`pwd` GOOS=windows GOARCH=amd64 go build -o bin/influxd.exe github.com/influxdb/influxdb/cmd/influxd | |
#GOPATH=`pwd` GOOS=windows GOARCH=amd64 go get -u -f github.com/influxdb/telegraf/cmd/telegraf | |
#GOPATH=`pwd` GOOS=windows GOARCH=amd64 go build -o bin/telegraf.exe github.com/influxdb/telegraf/cmd/telegraf |
I hereby claim:
To claim this, I am signing this object:
curl -LO https://github.com/clojure/clojurescript/releases/download/r3058/cljs.jar | |
mkdir -p src/hello | |
echo '(ns hello.core) (enable-console-print!) (println "Hello world!")' > src/hello/core.cljs | |
java -cp cljs.jar:src clojure.main -e '(require `cljs.closure) (cljs.closure/build "src" {:output-to "out/main.js"})' | |
echo '<html><body><script src="out/goog/base.js"></script><script src="out/main.js"></script><script>goog.require("hello.core")</script></body></html>' > index.html | |
open index.html |
boot -d com.github.jnr/jnr-ffi repl | |
=> (import jnr.ffi.LibraryLoader) | |
=> (definterface LibC (^int puts [^String s])) | |
=> (def libname (if (.contains (.toLowerCase (System/getProperty "os.name")) "windows") "msvcrt" "c")) | |
=> (def libc (.load (LibraryLoader/create LibC) libname)) |