In the name of God
This gist contains steps to setup Ubuntu 22.04
for deep learning.
FROM elixir:latest | |
# Install debian packages | |
RUN apt-get update && \ | |
apt-get install --yes build-essential inotify-tools postgresql-client git && \ | |
apt-get clean | |
ADD . /app | |
# Install Phoenix packages |
Short write up on using REPL when developing UIs in ClojureScript.
Everyone's standard approach to hot-reloading is to use a tool (Figwheel or shadow-cljs) that reloads changed namespaces automatically. This works really well: you change the code, the tool picks up changed files, compiles namespaces and dependants, notifies REPL client which then pulls in compiled changes, and re-runs a function that re-renders UI.
The other approach is to use ClojureScript's REPL directly and rely only on eval from the editor. This more or less matches Clojure style workflow. This approach might be useful when you don't want tools overhead or hot-reloading becomes slow for you or you just used to this style of interactions. Also changing code doesn't always mean that you want to reload all the changes. On the other hand it is very easy to change a couple of top-level forms and forget to eval one of them.
I looked into the state of GraalVM and Clojure and wrote some small work-related scripts.
type state = {products: RemoteData.t(array(Product.t), string)}; | |
type action = | |
| FetchProducts | |
| SetProducts(RemoteData.t(array(Product.t), string)); | |
let component = ReasonReact.reducerComponent(__MODULE__); | |
let make = _children => { | |
...component, | |
initialState: () => {products: NotAsked}, |
import { useState, useEffect } from 'react'; | |
function App() { | |
const columnCount = useMedia( | |
// Media queries | |
['(min-width: 1500px)', '(min-width: 1000px)', '(min-width: 600px)'], | |
// Column counts (relates to above media queries by array index) | |
[5, 4, 3], | |
// Default column count | |
2 |
[%bs.raw {|require("bootstrap/dist/css/bootstrap.min.css")|}]; | |
type complex = { | |
value: string, | |
className: string | |
}; | |
module BtnColorContext = | |
Context.MakePair({ | |
type t = complex; |
module StringContext = | |
Context.MakePair({ | |
type t = string; | |
let defaultValue = "Awesome"; | |
}); | |
let component = ReasonReact.statelessComponent("Tree"); | |
let make = _children => { |