- 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 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 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 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") |
This file contains 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 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 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 |
This file contains 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 | |
(partition 2 1) | |
(filter #(apply < %)) | |
count)) | |
(defn part-2 [input] | |
(->> input | |
(partition 3 1) | |
(map #(apply + %)) |
This example illustrates an intersting side effect of Clojure's lazy sequences when used in re-frame subscriptions. The behaviour described below takes place only on initial subscribe call
(reg-sub :test/x-2
(constantly [])
(fn [_ _]
(prn "evaluating body of " :test/x-2)
(map #(do (prn "evaluating lazy seq returned from " :test/x-2) (inc %)) (range 3))))
(reg-sub :test/x-1
NewerOlder