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
#include <avr/sleep.h> | |
volatile unsigned long count = 0L; | |
unsigned long lastClosed = 0L; | |
int sensorPin = 0; | |
int buzzPin = 1; | |
ISR(WDT_vect) { | |
count++; |
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
#include <SoftwareSerial.h> | |
#include <avr/sleep.h> | |
const int echoPin = 1; | |
const int trigPin = 2; | |
const int Rx = 3; // this is physical pin 2 | |
const int Tx = 4; // this is physical pin 3 | |
const int hcPin = 0; | |
SoftwareSerial mySerial(Rx, Tx); |
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
// Tool for adding checksum and header (if missing) to uBlox UBX message. | |
// by Martin Ždila <[email protected]> | |
// License: CC0 | |
const arg = process.argv[2]; | |
if (!arg) { | |
console.error(`Usage: process.argv[0] process.argv[1] AABBCCDD...`); | |
process.exit(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
#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; |
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 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 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
sqlite3 cesty_nlc_2017.sqlitedb "select writefile(z || '/' || x || '/' || y || '.png', image) from tiles" |
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
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 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
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 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 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 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
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); | |
}); |