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
import josm from "josm"; | |
import { RelationBuilder } from "josm/builder"; | |
const byName = {}; | |
const ds = josm.layers.activeLayer.getDataSet(); | |
const ways = ds.getWays(); | |
for (const way of ways) { |
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
/* | |
Overpass QL for the input file (mirecnet-false-fords.osm): | |
``` | |
[out:xml][timeout:600][bbox:{{bbox}}]; | |
( | |
way[highway]->.w1; | |
way[waterway]->.w2; | |
node[!"ford"](w.w1)(w.w2)(user:"Mirecnet"); | |
); |
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
export function pLimit(concurrency: number) { | |
let running = 0; | |
let resolves: (() => void)[] = []; | |
return async <T>(fn: () => Promise<T>): Promise<T> => { | |
if (running >= concurrency) { | |
await new Promise<void>((resolve) => { | |
resolves.push(resolve); | |
}); |
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 base = Deno.args[0]; | |
const data1 = await Deno.readFile(`in1/${base}.HGT`); | |
const data2 = await Deno.readFile(`in2/${base}.HGT`); | |
const buf1 = new DataView(data1.buffer); | |
const buf2 = new DataView(data2.buffer); | |
for (let i = 0; i < buf2.byteLength - 1; i += 2) { | |
const val = buf2.getInt16(i, false); |
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
import * as path from "https://deno.land/std/path/mod.ts"; | |
const encoder = new TextEncoder(); | |
const dot = encoder.encode("."); | |
const dash = encoder.encode("-"); | |
for (let zz = 18; zz >= 0; zz--) { | |
const base = `/home/martin/ofmozaika/${zz + 1}`; |
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
https://docs.google.com/presentation/d/1StVFtbWrN2iujCr_ie28kB-sG_aJm13BXGEVIB7Pp7k/edit?usp=sharing | |
https://docs.google.com/presentation/d/18ok8a-YQjlp1YVFpmxoogn04rxI2wBE4It2PigLWCDY/edit?usp=sharing |
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
sqlite3 cesty_nlc_2017.sqlitedb "select writefile(z || '/' || x || '/' || y || '.png', image) from tiles" |
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 fs = require('fs'); | |
const axios = require('axios'); | |
const parseSetCookie = require('set-cookie-parser'); | |
const querystring = require('querystring'); | |
class Cookies { | |
constructor() { | |
this.cookies = {}; | |
} |
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
#include <Arduino.h> | |
#include <ESP8266WiFi.h> | |
#include "DHT.h" | |
const char* ssid = "mywifi"; | |
const char* password = "mysecret"; | |
const char* host = "192.168.0.102"; | |
DHT dht; |
NewerOlder