Skip to content

Instantly share code, notes, and snippets.

@tiensonqin
tiensonqin / specs.clj
Created March 23, 2018 11:54 — forked from roman01la/specs.clj
Figma File API specs
(ns figma.specs
(:require [clojure.spec.alpha :as s]))
(def color-chan
(s/and number? #(<= 0 % 1)))
(def alpha-chan
(s/and number? #(<= 0 % 1)))
;;=============================================
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _affix = require('./affix');
Object.defineProperty(exports, 'Affix', {
enumerable: true,
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _affix = require('./affix');
Object.defineProperty(exports, 'Affix', {
enumerable: true,
open Antd
open Form
open ApolloClient
type action =
| EditEmail of string
| EditPassword of string
| Submit
type state = {
email: string;
password: string;}
open Antd;
open Form;
open ApolloClient;
type action =
| EditEmail(string)
| EditPassword(string)
| Submit;
open Jest
open Atom
let _ = test "Atom create" @@
fun () -> begin
let a = atom 0 in
ignore Expect.(expect @@ deref a |> toBe 0);
addWatch a 0 (fun _key _atom oldV newV ->
Js.log "oldV";
type meta
type 'a t = {
state: 'a ref;
meta: meta option;
validator: 'a validator option;
watches: (int, 'a fn) Hashtbl.t;
}
and 'a validator = 'a -> bool
and 'a fn =
(ns spurs.core
(:require [re-natal.support :as support]
[rum.core :as rum :refer-macros [defc defcc defcs]]
[cljs-exponent.components :refer [text view element] :as rn]
[clojure.string :as str]
[clojure.walk :as w]
[clojure.set :refer [rename-keys]]))
(def ExNavigation (js/require "@expo/ex-navigation"))
(def create-router (aget ExNavigation "createRouter"))
(ns myapp.core
(:require [re-natal.support :as support]
[rum.core :as rum :refer-macros [defc defcc]]
[cljs-exponent.components :refer [text view image touchable-highlight] :as rn]))
(defn ->react
"Convert a rum component to a react component."
[rum-component]
(:rum/class (meta rum-component)))
open Utils
let imperative_sort a =
let l = Array.length a in
for i = 0 to (l - 1) do
let min_idx = ref i in
for j = i + 1 to (l - 1) do
if (a.(j) < a.(!min_idx)) then min_idx := j
done;