Skip to content

Instantly share code, notes, and snippets.

View roman01la's full-sized avatar
🇺🇦

Roman Liutikov roman01la

🇺🇦
View GitHub Profile
(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)
var icons = [
"<svg height=\"32\" class=\"octicon octicon-mark-github text-white\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"32\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z\"></path></svg>",
"<svg height=\"24\" class=\"octicon octicon-x text-gray\" viewBox=\"0 0 12 16\" version=\"1.1\" width=\"18\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6
@roman01la
roman01la / extract_telegram_macos.ipynb
Created May 31, 2024 15:20 — forked from stek29/extract_telegram_macos.ipynb
Extract Telegram messages from db_sqlite PostBox – made for Telegram for macOS, but should work with Telegram for iOS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
@roman01la
roman01la / blend.py
Created May 15, 2024 11:09
Running Blender on multiple GPUs on Modal.com
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")
@roman01la
roman01la / build
Created March 14, 2017 11:59
Gambit Scheme JavaScript target
$ cd lib
$ make _gambit.js
$ cd ..
$ gsc/gsc -:=. -warnings -target js code.scm
$ gsc/gsc -:=. -warnings -target js -link -l lib/_gambit.js code.js
$ cat code_.js code.js lib/_gambit.js > p.js
$ node p.js
@roman01la
roman01la / index.html
Created June 17, 2013 01:32
THREE.js scene setup with JSONLoader for OSM2WebGL demo
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="viewport"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r58/three.min.js"></script>
<script src="//threejs.org/examples/js/controls/OrbitControls.js"></script>
@roman01la
roman01la / README.md
Created May 20, 2023 17:00
Export large scale map from OSM
  1. Go to https://www.openstreetmap.org/export#map=11/48.6129/38.2221
  2. Choose your area for export
  3. Put export bounding box longitude and latitude into calc_tiles.py and run it to calculate which tiles to has to be downloaded
  4. Create tiles directory
  5. Put calculated coordinates into download_tiles.js and run it do download tiles (couldn't make downloading work in Python)
  6. Put calculated coordinates into stitch_tiles.py and run it
  7. The output will be stored in map.png file
@roman01la
roman01la / gui.js
Created April 7, 2023 11:35
raylib
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))
);
@roman01la
roman01la / analyze.clj
Created March 18, 2021 01:42
analyzing unused and undefined re-frame subscriptions via clj-kondo
(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)