Skip to content

Instantly share code, notes, and snippets.

'''
Shorthand decorator for the common case of looking up ORM objects from
named URL parameters.
For each named URL parameter passed to the view of the form
``db_table_id``, look up the ORM object in the corresponding model with
the given primary key, returning a 404 in case it is not found.
For example:
(defn evens
([] nil)
([x] nil)
([x y & xs]
(lazy-seq (cons y (apply evens xs)))))
(defn factorial [n]
(reduce * (range 1 (inc n))))
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.WatchEvent;
import java.nio.file.WatchKey;
import java.nio.file.WatchService;
import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Stream;