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
| /***************************************************************************** | |
| ** OpenSCAD Example Code by Michal Altair Valasek - https://www.rider.cz ** | |
| ** Licensed under terms of Creative Commons Attribution License (cc-by) ** | |
| ** https://creativecommons.org/licenses/by/4.0/ ** | |
| *****************************************************************************/ | |
| base_width = 40; // X | |
| base_depth = 30; // Y | |
| base_height = 20; // Z | |
| wall = 1; |
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 table if not exists migrations ( | |
| key text CONSTRAINT pkey PRIMARY KEY | |
| ); | |
| create or replace function idempotent(migration_name text,code text) returns void as $$ | |
| begin | |
| if exists (select key from migrations where key=migration_name) then | |
| raise notice 'Migration already applied: %', migration_name; | |
| else | |
| raise notice 'Running migration: %', migration_name; |
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 datascript-to-datomic-util | |
| (:require [datascript :as d])) | |
| ;;;; a utility to help with a datomic-datascript roundtrip process involving: | |
| ;;; 1. export some data from a datomic database and transact into a datascript instance. | |
| ;;; 2. perform one or more transactions against datascript. | |
| ;;; 3. transact the sum of all changes made against datascript back into datomic in a single tx | |
| ;;; this namespace contains two public functions: | |
| ;;; listen-for-changes: listen to datascript transactions and build up a record of changes |
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 ptrn | |
| { | |
| :a {:pattern #"a(?!b)" | |
| :purpose "Only allow a if it is not preceded by a 'b' (negative lookahead)" | |
| :samples ["acdefg" ; ok | |
| "abcdef" ; nil | |
| ]} | |
| :b {:pattern #"(?i)(<title.*?>)(.+?)(</title>)" |
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 clob-to-string [clob] | |
| "Turn an Oracle Clob into a String" | |
| (with-open [rdr (java.io.BufferedReader. (.getCharacterStream clob))] | |
| (apply str (line-seq rdr)))) | |
| (with-connection mydb | |
| (transaction | |
| (with-query-results rs ["select documentation from station"] | |
| ; rs will be a sequence of maps, | |
| ; one for each record in the result set. |
NewerOlder