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 COLORS ["#f44336" "#E91E63" "#9C27B0" "#673AB7" "#3F51B5" "#2196F3" "#03A9F4" "#00BCD4" "#009688" "#4CAF50" "#8BC34A" "#CDDC39" "#FFEB3B" "#FFC107" "#FF9800" "#FF5722" "#795548" "#9E9E9E" "#607D8B" "#ffebee" "#FCE4EC" "#F3E5F5" "#EDE7F6" "#E8EAF6" "#E3F2FD" "#E1F5FE" "#E0F7FA" "#E0F2F1" "#E8F5E9" "#F1F8E9" "#F9FBE7" "#FFFDE7" "#FFF8E1" "#FFF3E0" "#FBE9E7" "#EFEBE9" "#FAFAFA" "#ECEFF1" "#ffcdd2" "#F8BBD0" "#E1BEE7" "#D1C4E9" "#C5CAE9" "#BBDEFB" "#B3E5FC" "#B2EBF2" "#B2DFDB" "#C8E6C9" "#DCEDC8" "#F0F4C3" "#FFF9C4" "#FFECB3" "#FFE0B2" "#FFCCBC" "#D7CCC8" "#F5F5F5" "#CFD8DC" "#ef9a9a" "#F48FB1" "#CE93D8" "#B39DDB" "#9FA8DA" "#90CAF9" "#81D4FA" "#80DEEA" "#80CBC4" "#A5D6A7" "#C5E1A5" "#E6EE9C" "#FFF59D" "#FFE082" "#FFCC80" "#FFAB91" "#BCAAA4" "#EEEEEE" "#B0BEC5" "#e57373" "#F06292" "#BA68C8" "#9575CD" "#7986CB" "#64B5F6" "#4FC3F7" "#4DD0E1" "#4DB6AC" "#81C784" "#AED581" "#DCE775" "#FFF176" "#FFD54F" "#FFB74D" "#FF8A65" "#A1887F" "#E0E0E0" "#90A4AE" "#ef5350" "#EC407A" "#AB47BC" "#7E57C2" "#5C6BC0" "#42A5F5" " |
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
# From http://www.imagemagick.org/discourse-server/viewtopic.php?t=12619 | |
# Turn white background image to transparent | |
convert image-old.png -transparent white image-new.png | |
# not perfectly white (aliasing) with fuzz percentage | |
convert image-old.png -fuzz 95% -transparent white image-new.png |
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
(let [es-url "http://localhost:9200" | |
es-mapping-name "caudal-mapping" | |
es-index-name "caudal-index" | |
es-mapping {es-mapping-name {:properties {:TYPE {:type "string" :index "not_analyzed"} | |
:COUNTRY {:type "string" :index "not_analyzed"} | |
:HOST_ORIGIN {:type "string" :index "not_analyzed"} | |
:ACTION {:type "string" :index "not_analyzed"} | |
:NAME_OF_QUALIFIER {:type "string" :index "not_analyzed"} | |
:AUTHORIZATION_RULE_ID {:type "string" :index "not_analyzed"} | |
:AUTHORIZATION_INDICATOR {:type "string" :index "not_analyzed"} |
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
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
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 files-in-depth | |
"Walk `path` recursivelly and retrieves a vector with all regular files" | |
[path] | |
(loop [files [] acums [path]] | |
(if-not (empty? acums) | |
(if (Files/isDirectory (peek acums) (into-array (LinkOption/values))) | |
(let [stream (Files/newDirectoryStream (peek acums))] | |
(recur files (into (pop acums) (iterator-seq (.iterator stream))))) | |
(recur (conj files (peek acums)) (pop acums))) | |
files))) |
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 rename [path-file new-name] | |
(try | |
(Files/move path-file (.resolveSibling path-file new-name) (into-array [StandardCopyOption/ATOMIC_MOVE])) | |
(catch Exception e | |
(.printStackTrace e) | |
nil))) |
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 month-text-to-number [text & [locale]] | |
(let [loc (if locale locale java.util.Locale/ENGLISH) | |
dfmt (java.text.SimpleDateFormat. "MMM" loc) | |
date (.parse dfmt text) | |
cal (doto (java.util.Calendar/getInstance) | |
(.setTime date))] | |
(.get cal java.util.Calendar/MONTH))) |
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
;; Query time: 13 msec | |
;; SERVER: 8.8.8.8#53(8.8.8.8) | |
;; WHEN: Thu Oct 27 14:05:26 2016 | |
;; MSG SIZE rcvd: 53 | |
size inuse free pin virtual mmode | |
memory 4030464 3606573 423891 821507 2071729 Ded | |
pg space 4325376 28186 |
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
curl -X POST http://localhost:9200/_reindex -d '{ | |
"source": { | |
"index": "twitter" | |
}, | |
"dest": { | |
"index": "new_twitter" | |
} | |
}' | |
curl -X DELETE http://localhost:9200/twitter |
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
guest readonly | |
admin readwrite |