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
| (defproject myapp "0.1.0-PROOF-OF-CONCEPT" | |
| :description "" | |
| :dependencies [[org.clojure/clojure "1.4.0"] | |
| [postgresql/postgresql "9.1-901.jdbc4"] | |
| [noir "1.3.0-beta10"] | |
| [crudite "0.1.1"] | |
| [org.clojure/java.jdbc "0.2.3"] | |
| [cljs-uuid "0.0.3"] | |
| [clj-time "0.4.4"] | |
| [noir-cljs "0.3.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 c.column_name, c.is_nullable, c.character_maximum_length, c.numeric_precision, c.numeric_scale, c.udt_name, tc.constraint_type | |
| FROM ((information_schema.columns as c | |
| INNER | |
| JOIN information_schema.constraint_column_usage as ccu | |
| ON c.column_name = ccu.column_name) | |
| INNER | |
| JOIN information_schema.table_constraints as tc | |
| ON tc.constraint_name = ccu.constraint_name) | |
| WHERE table_name = 'users'; |
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
| column_name | is_nullable | character_maximum_length | numeric_precision | numeric_scale | udt_name | unique | |
| ---------------------+-------------+--------------------------+-------------------+---------------+-----------+-------- | |
| distance | YES | | 32 | 0 | int4 | | |
| setting_preset_uuid | YES | | | | uuid | | |
| blocks | YES | | | | _uuid | | |
| longitude_home | YES | | 9 | 6 | numeric | | |
| latitude_home | YES | | 9 | 6 | numeric | | |
| available_invites | YES | | 16 | 0 | int2 | | |
| longitude_meeting | YES | | 9 | 6 | numeri |
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 foo | |
| (let [eggs #(str %)] | |
| ([x y] (println (eggs x) y)) | |
| ([x] (println (eggs 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
| (defn insert | |
| "Insert user registration invitation." | |
| [to_email] | |
| (let [invite-id (make-random)] | |
| (db/insert :invites | |
| {:id invite-id | |
| :to_email to_email | |
| :created_at (to-sql-date (now)) | |
| :users_id (app.session/get :id)}) | |
| (.toString invite-id))) |
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 hy | |
| ; Author: <Carlos C. Fontes> ccfontes@gmail.com | |
| (defn cljs-modified? | |
| """Verifies if the Clojurescript sources were modified since last build.""" | |
| [] | |
| (let [ls-by-time-modified (partial ls "-t")] | |
| (-> (glob "src-cljs/app/*.cljs") | |
| (ls-by-time-modified "resources/public/js/main.js") | |
| .split |
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 hy | |
| ; Author: <Carlos C. Fontes> ccfontes@gmail.com | |
| (import [sh [cat lein echo tee rm]]) | |
| (import [script.hy-lib.hyclops.hyclops [comp]]) ; you must provide this your own | |
| (setv irrelevant-note-patterns | |
| ["/.repl/" "/out/" "/README.md" "/target/" "/script/hy_lib/"]) | |
| (defn irrelevant-note? |
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 hy | |
| ; Author: <Carlos C. Fontes> ccfontes@gmail.com | |
| (import [sh [touch ls lein sleep]] | |
| [glob [glob]] | |
| sys | |
| [subprocess [call Popen PIPE STDOUT]] | |
| [thread [start_new_thread]]) | |
| (defn with-print-call [exe] |
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
| ; 1. rename attribute: :url/path → :legacy/url-path-v1 | |
| (do (require '[datomic.api :as datomic] '[kanasubs.db :as db]) | |
| (datomic/transact @db/connection | |
| [{:db/id :url/path, :db/ident :legacy/url-path-v1}])) | |
| ; 2. repurpose :url/path | |
| (do (in-ns 'kanasubs.db) | |
| (transact @connection | |
| [{:db/id #db/id[:db.part/db] | |
| :db/ident :url/path |
OlderNewer