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
(d/q '[:find ?e ?email | |
:in $ ?ent | |
:where | |
[?e :permission/ent ?ent] | |
(or | |
(and | |
[?e :permission/user ?user] | |
[?user :user/email ?email]) | |
[?user :permission/email ?email])] | |
_db id) |
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 paginate-all-ents [page pp _db & [return-ent?]] | |
(let [_drop (* page pp)] | |
(->> (d/seek-datoms (db/_d) :avet :content/fk) | |
(drop _drop) | |
(take pp) | |
(map (fn [_datom] | |
(if return-ent? | |
(ret-rec | |
(db/by-id (nth _datom 0 ) _db)) | |
(nth _datom 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
ubuntu@ip-172-31-8-69:~/datomic-pro-0.9.5385$ bin/datomic -Xmx4g -Xms4g backup-db datomic:ddb://us-east-1/datomic-new/blablabla s3://im-datomic-backups/backup1 | |
java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter | |
at com.amazonaws.util.Base64.encodeAsString(Base64.java:39) | |
at com.amazonaws.auth.AbstractAWSSigner.signAndBase64Encode(AbstractAWSSigner.java:78) | |
at com.amazonaws.auth.AbstractAWSSigner.signAndBase64Encode(AbstractAWSSigner.java:67) | |
at com.amazonaws.services.s3.internal.S3Signer.sign(S3Signer.java:174) | |
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:760) | |
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:630) | |
at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:405) | |
at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:367) |
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 min-max-calc [] | |
(let [mode @rpick/mode ;; a variable that is 0,1,or 2 | |
[min max] (case mode ;; destructuring in action: switch / case returns vector, assigns names min / max same time | |
0 [180.0 250.0] | |
1 [250 400 ] | |
2 [400 650 ] | |
[180.0 250.0]) | |
width (- ;; actually kinda shitty... i should be passing the width as a param... this funciton | |
(utils/portal-width) ;; shuoldn't know that there's a div with 30px padding | |
30)] |
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
User.find(x).lightboxes.each do |lb| | |
new_lb = lb.dup; | |
new_lb.user_id = 16624; | |
new_lb.save; | |
lb.lightbox_photos.each do |lbp| | |
new_lbp = lbp.dup; | |
new_lbp.lightbox_id = new_lb.id; | |
new_lbp.save; | |
end | |
end |
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 im.pages.debug | |
(:require-macros [cljs.core.async.macros :refer [go go-loop]]) | |
(:require | |
[im.chans :as chans] | |
[im.utils :as utils] | |
[taoensso.timbre :as timbre | |
:refer-macros (debug)] | |
[reagent.core :as reagent :refer [atom cursor]] | |
[cljs.core.async :refer [tap put! chan <! >! timeout close! mult]] | |
[im.stores.content :as content] |
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
; datomic func | |
[{:db/id #db/id [:db.part/user] | |
:db/ident :person/namer | |
:db/doc "ensures unique name" | |
:db/fn #db/fn {:lang "clojure" | |
:params [db oid name] | |
:code "(let [ e (datomic.api/q | |
'[:find ?e | |
:in $ ?oid ?name |
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
[{:db/id #db/id [:db.part/user] | |
:db/ident :person/namer | |
:db/doc "ensures unique name" | |
:db/fn #db/fn {:lang "clojure" | |
:params [db oid name] | |
:code "(let [ e (datomic.api/q | |
'[:find ?e | |
:in $ ?oid ?name | |
:where | |
[?e :person/name ?name] |
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 upload-all-files [] | |
(debug "RUNNING BATCH") | |
(remove-all-empty-dirs) | |
(rm-lr-data) | |
(Thread/sleep 5000) | |
(remove-all-empty-dirs) | |
(rm-lr-data) | |
(let [files (vec (filter (fn [e] (not (ignorable-file e))) (fs)))] | |
(debug :FILECOUNT (count files)) | |
(let [output (pmap prep-upload files)] |
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
16-05-24 18:46:14 ip-172-31-33-208 INFO [thumbucket.utils.zip:18] - START ZIP WITH CMD: zip /tmp/20160523_BANDIER_SELF_JS_TS_16233.zip -r /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16233_2026567.jpg /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16233_2026568.jpg /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16233_2026569.jpg /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16233_2026570.jpg /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16233_2026571.jpg /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16233_2026572.jpg /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16233_2026573.jpg /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16233_2026574.jpg /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16233_2026575.jpg /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16233_2026576.jpg /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16233_2026577.jpg /tmp/1464115566841_20160523_BANDIER_SELF_JS_TS_16233/BFA_16 |