Set up a directory with project.clj
below.
Create namespaces in src/clj/server/core.clj
and src/cljs/client/core.cljs
Create an index.html as below in resource/public/
.
Start two REPLs with ' "
(jack-in-cljs)
Then in CLJS repl:
/// The ring leader | |
final class ModalTransitioningDelegate: NSObject, UIViewControllerTransitioningDelegate { | |
func presentationController( | |
forPresented presented: UIViewController, | |
presenting: UIViewController?, | |
source: UIViewController | |
) -> UIPresentationController? { | |
return PresentationController(presentedViewController: presented, presenting: presenting) | |
} |
// Basic idea from https://swiftui-lab.com/communicating-with-the-view-tree-part-1/ | |
import SwiftUI | |
// --- Provides support for a child to propogate its frame | |
struct ChildPreferenceData: Equatable { | |
let idx: Int | |
let bounds: CGRect | |
} |
Set up a directory with project.clj
below.
Create namespaces in src/clj/server/core.clj
and src/cljs/client/core.cljs
Create an index.html as below in resource/public/
.
Start two REPLs with ' "
(jack-in-cljs)
Then in CLJS repl:
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
border: no | |
license: mit | |
height: 650 |
border: no | |
license: mit | |
height: 640 |
border: no | |
license: gpl-3.0 |
Inspired from https://drboolean.gitbooks.io/mostly-adequate-guide/content/ch5.html | |
// Curries by partially applying 1 out of 2 arguments | |
func curry<A, B, C>(fn: (A, B) -> C, _ val: A) -> (B -> C) { | |
return { b in | |
fn(val, b) | |
} | |
} | |
// "compose" operator |
module Main where | |
import Control.Monad | |
import Data.Char (toLower) | |
import Data.Maybe (isJust, isNothing, fromMaybe) | |
import Data.List (intersperse) | |
import System.Exit (exitSuccess) | |
import System.Random (randomRIO) | |
data Puzzle = Puzzle String [Maybe Char] String |