https://sandbox.learn-modern-clojurescript.com/ architecture overview
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 uix.examples | |
(:require | |
;; TanStack Router v1 (CJS bundle brought in by Shadow) | |
["@tanstack/react-router" :as rr | |
:refer [Link Outlet RouterProvider]] | |
;; JS <‑‑> CLJ map/keyword conversion | |
[cljs-bean.core :refer [->clj]] | |
;; uix “React‑with‑hiccup” runtime | |
[uix.core :refer [$ defui strict-mode]] | |
[uix.dom :as dom])) |
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 uix.ssr | |
(:require [uix.core :as uix :refer [$ defui]] | |
#?(:cljs ["react-slider" :as react.slider]) | |
#?(:clj [uix.dom.server :as dom.server]))) | |
#?(:cljs | |
(defui js-comp* [{:keys [children]}] | |
(let [[show? set-show] (uix/use-state false)] | |
(uix/use-effect | |
#(set-show true) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
sudo apt install -y iptables hostapd dnsmasq dhcpcd5 isc-dhcp-server python3-pip python3-venv | |
sudo nano /etc/dhcpcd.conf | |
interface wlan0 | |
static ip_address=192.168.42.1/24 | |
nohook wpa_supplicant | |
sudo nano /etc/dhcp/dhcpd.conf |
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 pathlib import Path | |
from typing import Dict | |
import modal | |
import modal.gpu | |
app = modal.App("blender") | |
rendering_image = ( | |
modal.Image.debian_slim(python_version="3.11") | |
.apt_install("xorg", "libxkbcommon0", "ffmpeg") |
- Go to https://www.openstreetmap.org/export#map=11/48.6129/38.2221
- Choose your area for export
- Put export bounding box longitude and latitude into
calc_tiles.py
and run it to calculate which tiles to has to be downloaded - Create
tiles
directory - Put calculated coordinates into
download_tiles.js
and run it do download tiles (couldn't make downloading work in Python) - Put calculated coordinates into
stitch_tiles.py
and run it - The output will be stored in
map.png
file
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
const r = require("raylib/drm/index"); | |
const net = require("net"); | |
const path = require("path"); | |
const { pexec } = require("./utils"); | |
const renderer = require("./renderer"); | |
function getScreenSize() { | |
return pexec(`fbset -s | grep "geometry" | awk '{print $2" "$3}'`).then((r) => | |
r.split(" ").map((s) => parseInt(s, 10)) | |
); |
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
(defn part-1 [input] | |
(->> input | |
str/split-lines | |
(map seq) | |
(apply map list) | |
(map #(vals (into (sorted-map) (set/map-invert (frequencies %))))) | |
(apply map list) | |
(map (comp #(Integer/parseInt % 2) str/join)) | |
(apply *))) |
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
(defn parse-input [input] | |
(->> input | |
(str/split-lines) | |
(map #(let [[v n] (str/split % #" ")] | |
[v (Integer/parseInt n)])))) | |
(defn part-1 [input] | |
(->> (parse-input input) | |
(reduce (fn [[h d] [v n]] | |
(case v |
NewerOlder