- 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.pyand run it to calculate which tiles to has to be downloaded - Create
tilesdirectory - Put calculated coordinates into
download_tiles.jsand run it do download tiles (couldn't make downloading work in Python) - Put calculated coordinates into
stitch_tiles.pyand run it - The output will be stored in
map.pngfile
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") |
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 |
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 | |
| (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
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 analyze.core | |
| (:require [clj-kondo.core :as clj-kondo] | |
| [clojure.set :as set])) | |
| ;; checks re-frame's :<- syntax | |
| ;; to mark dependency subscriptions as used | |
| (def analyze-reg-sub | |
| "(require '[clj-kondo.hooks-api :as api]) | |
| (fn [{node :node}] | |
| (let [[_ kw & children] (:children node) |
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
| (->> (clojure.string/split (slurp "input_02") #"\n") | |
| (map #(re-find #"(\d+)-(\d+) (\w): (\w+)" %)) | |
| (filter (fn [[_ min max char string]] | |
| (>= (Integer/parseInt max) | |
| (count (re-seq (re-pattern char) string)) | |
| (Integer/parseInt min)))) | |
| count) | |
| (->> (clojure.string/split (slurp "input_02") #"\n") | |
| (map #(re-find #"(\d+)-(\d+) (\w): (\w+)" %)) |