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
| (comment "This is a small experiment inspired by Oskar Wickströms | |
| excellent work at | |
| https://haskell-at-work.com/episodes/2018-01-19-domain-modelling-with-haskell-data-structures.html. | |
| I wanted to see what would be involved in building the equivalent | |
| functionality in reasonably ideomatic Clojure. It is also my first | |
| from scratch use of Clojure spec, which was a very interesting and | |
| productive experience. It is amazing how little work one has to do | |
| to be able to generate example datastructures for testing. The | |
| generated examples helped me find a subtle bug in the tree pretty | |
| printer, that would have been hard to find without." "I would love |
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 python:3.6-stretch as python-base | |
| COPY webpack requirements.txt package.json yarn.lock ./ | |
| RUN set -ex \ | |
| && apt-get update \ | |
| && apt-get install apt-transport-https \ | |
| && apt-get update \ | |
| && apt-get install --no-install-recommends -y \ | |
| libpq-dev curl libjpeg-dev rsync libsass-dev libicu57 zlib1g-dev libpng-dev libmagickwand-dev \ |
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
| [uwsgi] | |
| http = :8000 | |
| http-keepalive = 1 | |
| http-auto-chunked = 1 | |
| wsgi-file = config/wsgi_prod.py | |
| master = true | |
| processes = 8 | |
| threads = 2 | |
| enable-threads = True | |
| gid = 2000 |
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
| ;; This is the Wikipedia entry example encoded graph. | |
| (def graph {:orig [{:a 1.5 :d 2} 0] | |
| :a [{:orig 1.5 :b 2} 4] | |
| :b [{:a 2 :c 3} 2] | |
| :c [{:b 3 :dest 4} 4] | |
| :dest [{:c 4 :e 2} 0] | |
| :e [{:dest 2 :d 3} 2] | |
| :d [{:orig 2 :e 3} 4.5]}) | |
| (defn a* [graph orig dest] |
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
| module Ellie.Ui.CodeEditor | |
| exposing | |
| ( Attribute | |
| , LinterMessage | |
| , Position | |
| , Severity(..) | |
| , linterMessages | |
| , mode | |
| , onChange | |
| , readOnly |
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 railway-oriented-programming | |
| "An adaptation of [Railway Oriented Programming](rop) using the | |
| [Cats](cats) library in Clojure. | |
| [rop]: http://fsharpforfunandprofit.com/posts/recipe-part2/ | |
| [cats]: https://github.com/funcool/cats" | |
| (:require [cats.builtin] | |
| [cats.core :as cats] | |
| [cats.monad.either :as either])) |
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
| dependencies = [ | |
| ('wagtailcore', '0040_page_draft_title'), | |
| ('wagtailredirects', '0006_redirect_increase_max_length'), | |
| ('wagtailcore', '0041_group_collection_permissions_verbose_name_plural'), | |
| ('wagtailforms', '0003_capitalizeverbose'), | |
| ('taggit', '0002_auto_20150616_2121'), | |
| ('wagtailimages', '0019_delete_filter'), | |
| ] | |
| The dependencies are i'm assuming referencing the old way wagtai modules were named. |
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 | |
| psa.datname as database, | |
| psa.query as current_query, | |
| clock_timestamp() - psa.xact_start AS transaction_age, | |
| array_agg(distinct c.relname) AS tables_with_locks | |
| FROM pg_catalog.pg_stat_activity psa | |
| JOIN pg_catalog.pg_locks l ON (psa.pid = l.pid) | |
| JOIN pg_catalog.pg_class c ON (l.relation = c.oid) | |
| JOIN pg_catalog.pg_namespace ns ON (c.relnamespace = ns.oid) | |
| WHERE psa.pid != pg_backend_pid() |
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 | |
| seq_scan, | |
| seq_tup_read, | |
| idx_scan, | |
| idx_tup_fetch, | |
| n_tup_ins, | |
| n_tup_upd, | |
| n_tup_del | |
| FROM pg_catalog.pg_stat_user_tables | |
| WHERE relname = '<table>'; |
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 | |
| relname, | |
| relfilenode | |
| FROM pg_catalog.pg_class | |
| WHERE relname in ( | |
| '<table>', | |
| '<index>' | |
| ) | |
| -- Order by oid for convenience if you're checking multiple relations. | |
| ORDER BY oid; |