CREATE OR REPLACE FUNCTION extract_cols_as_char (tablename CHARACTER, my_prefix CHARACTER DEFAULT '')
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
| (defun copy-current-line-position-to-clipboard () | |
| "Copy current line in file to clipboard as '</path/to/file>:<line-number>'" | |
| (interactive) | |
| (let ((path-with-line-number | |
| (concat (buffer-file-name) "::" (number-to-string (line-number-at-pos))))) | |
| (when path-with-line-number | |
| (with-temp-buffer | |
| (insert path-with-line-number) | |
| (clipboard-kill-region (point-min) (point-max))) | |
| (message (concat path-with-line-number " copied to clipboard"))))) |
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
| ;; using docker-compose up, we loose the cider ability to navigate definitions with `C - .` due the source of current (docker) nrepl is under a different path `/app/src` instead of akvo-lumen local git repo | |
| ;; so the trick is to replace docker source paths by user-local-paths. | |
| ((nil . ((eval . (defun to-local-paths (info) | |
| "adapt src and .m2 docker paths to local paths" | |
| (let* ((file (nrepl-dict-get info "file")) | |
| (res-0 (progn | |
| (replace-regexp-in-string "/app/" (clojure-project-dir) file)))) | |
| (replace-regexp-in-string "/home/akvo/.m2/" | |
| (concat (getenv "HOME") "/.m2/") |
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
| java.lang.IllegalStateException: | |
| Attempt to remove an object from the bag that was not borrowed or reserved | |
| ConcurrentBag.java:207 com.zaxxer.hikari.util.ConcurrentBag.remove | |
| HikariPool.java:394 com.zaxxer.hikari.pool.HikariPool.closeConnection | |
| HikariPool.java:223 com.zaxxer.hikari.pool.HikariPool.releaseConnection | |
| ConnectionProxy.java:216 com.zaxxer.hikari.proxy.ConnectionProxy.close | |
| jdbc.clj:1014 clojure.java.jdbc/db-query-with-resultset* | |
| jdbc.clj:996 clojure.java.jdbc/db-query-with-resultset* | |
| jdbc.clj:1090 clojure.java.jdbc/query | |
| jdbc.clj:1047 clojure.java.jdbc/query |
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
| CREATE OR REPLACE FUNCTION history.log_change() RETURNS trigger AS $_$ | |
| DECLARE | |
| c refcursor; | |
| tt tstzrange; | |
| r record; | |
| str text; | |
| my_new text; | |
| BEGIN | |
| str := ''; |
Created from the plain text reference card on orgmode.org Download this file, and open it in Emacs org-mode!
Created from the plain text reference card on orgmode.org Download this file, and open it in Emacs org-mode!
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
| (in-ns 'akvo.lumen.specs.aggregation) | |
| (def s* lumen.s/sample) | |
| (s* ::l.aggregation.filter/filter) | |
| ;; => {:operation "remove", | |
| ;; :strategy "isLower", | |
| ;; :value "3hrEm8YaB0ZxnuS", | |
| ;; :column | |
| ;; {:columnName "d3", |
(defn- parse
"Parse years collection into years integer collection. Example: from ['1978' '1956' ...] to (1978 1956)"
[col*]
(map #(Integer/parseInt %) col*))
(defn- group-consecutive-years
"Example: from (2014 2010 2011 2012 2015 2016 2017) to ((2010 2011 2012) (2014 2015 2016 2017))"The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.
- Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
- Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
- Once documentation has been written, development should commence, and test-driven development is preferred.
- Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
- When a feature is being modified, it should be modified documentation-first.
- When documentation is modified, so should be the tests.