This file contains hidden or 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 lein-to-deps [list-deps] | |
(letfn [(xform [[lib version & others]] | |
(let [params (apply hash-map others)] | |
[lib (merge {:mvn/version version} params)]))] | |
(binding[*print-namespace-maps* false | |
pprint/*print-right-margin* 500] | |
(pprint | |
(into {} (map xform list-deps)))))) | |
(lein-to-deps '[[org.clojure/clojure "1.9.0"] |
This file contains hidden or 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
select | |
events.id 'event_id', | |
events.lon, | |
events.lat, | |
JSON_ARRAYAGG( | |
JSON_OBJECT( | |
'DynamicTypeDate', fdf.DynamicTypeDate, | |
'TotalArea', fdf.TotalArea, 'FillDate', | |
fdf.FillDate, 'FillTime', fdf.FillTime, | |
'DynamicTypeTime', fdf.DynamicTypeTime, |
This file contains hidden or 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 urls (array "http://a.tile.openstreetmap.org/${z}/${x}/${y}.png" | |
"http://b.tile.openstreetmap.org/${z}/${x}/${y}.png" | |
"http://c.tile.openstreetmap.org/${z}/${x}/${y}.png")) | |
(def OSM (js/OpenLayers.Layer.XYZ. "OSM (with buffer)" urls (extend-object! (js-obj) {"transitionEffect" "resize" | |
"buffer" 2 | |
"wrapDateLine" true | |
"sphericalMercator" true}))) | |
(def plot (js/OpenLayers.Map. (extend-object! (js-obj) {"div" "plot" |
This file contains hidden or 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 react-components.core | |
(:require [reagent.core :as reagent :refer [atom]])) | |
(enable-console-print!) | |
(defonce app-state | |
(atom {:text "Hello world!" | |
:plain {:comment "and I can take props from the atom"}})) | |
(defn comment-box [] |
This file contains hidden or 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 react-components.core | |
(:require [reagent.core :as reagent :refer [atom]])) | |
(enable-console-print!) | |
(defonce app-state | |
(atom {:text "Hello world!" | |
:plain {:comment "and I can take props from the atom"}})) | |
(defn comment-box [] |
This file contains hidden or 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 react-tutorial.core | |
(:require | |
[reagent.core :as r])) | |
(defn Square [value click-fn] | |
[:button.square {:on-click click-fn} value]) | |
(defn Board [] | |
(let [squares (r/atom (apply vector (repeat 9 nil))) | |
handle-click #(swap! squares assoc % "X") |
This file contains hidden or 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 dt.core | |
(:require [datascript.core :as d])) | |
;; schema so nice | |
(def schema {:maker/email {:db/unique :db.unique/identity} | |
:car/model {:db/unique :db.unique/identity} | |
:car/maker {:db/type :db.type/ref} | |
:car/colors {:db/cardinality :db.cardinality/many}}) |
This file contains hidden or 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
#!/usr/bin/env python | |
import sys, os, re | |
import datetime, time | |
import csv | |
import psycopg2, psycopg2.extras | |
import logging | |
logger = logging.getLogger(__name__) | |
help_text = """De-duplicate MODIS fire downloaded from FIRMS in CSV format. |
This file contains hidden or 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 vice | |
(:require [clojure.spec :as s] | |
[clj-time.core :as t] | |
[clj-time.format :as tf]) | |
(:import [org.joda.time DateMidnight DateTime] | |
[java.util UUID] | |
[clojure.lang Keyword] | |
[java.math BigInteger] | |
[java.net URL URI] | |
[java.util.regex Pattern])) |
This file contains hidden or 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
apt-get install --assume-yes build-essential cmake git pkg-config unzip ffmpeg python-dev python3-dev python-numpy python3-numpy libopencv-dev libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev libavcodec-dev libv4l-dev libtbb-dev v4l-utils vtk6 liblapacke-dev libopenblas-dev libgdal-dev checkinstall zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libjasper-dev libopenexr-dev libgdal-dev libdc1394-22-dev libavcodec-dev libv4l-dev libtbb-dev libeigen3-dev python-dev python-numpy python3-dev python3-numpy python3-pip | |
wget https://github.com/opencv/opencv/archive/3.3.1.zip | |
unzip 3.3.1.zip | |
rm 3.3.1.zip | |
mv opencv-3.3.1 /opt/opencv | |
mkdir /opt/opencv/build | |
cd /opt/opencv/build |