Skip to content

Instantly share code, notes, and snippets.

View onliniak's full-sized avatar

Rafael Pszenny onliniak

  • Poland, Gdynia
View GitHub Profile
@onliniak
onliniak / log.gr
Last active June 15, 2024 12:00
uber complicated logarithm algorithm
module Main
let log = (b: Number, x: Number) => {
for (let mut i = 0; i < 1000; i += 1) {
if (b ** i == x) return i
}
return 0
}
print(log(2, 16))
@onliniak
onliniak / wasm.cr
Last active June 13, 2024 12:02
WAMR C Bindings
@[Link("iwasm")]
lib LibWasm
struct WASMModuleCommon
buffer : UInt8*
binary_file : UInt32
io_error : LibC::Char*
io_error_bytesize : UInt32
end
struct WASMModuleInstanceCommon
@onliniak
onliniak / .replit
Created February 4, 2024 17:42
wasm nixos
run = "crystal run main.cr"
# crystal build main.cr --cross-compile --target wasm32-unknown-wasi
# wasm2wat main.wasm -o main.wat
## wasm2c main.wasm --no-debug-names -o main.c
## gcc -O3 -march=native -c main.c -o main.o
entrypoint = "main.cr"
[nix]
channel = "stable-23_11"
@onliniak
onliniak / trekking-avoid-highway
Last active June 4, 2023 18:07
BRouter roads avoid
# *** The trekking profile is for slow travel
# *** and avoiding car traffic, but still with
# *** a focus on approaching your destination
# *** efficiently.
#
# *** Unikaj wszystkich dróg samochodowych.
# *** W pierwszej kolejności wybierz drogi
# *** rowerowe, a w drugiej piesze.
# *** Unikaj miękkiej nawierzchni.
#
@onliniak
onliniak / trekking-avoid-cars.brf
Last active June 2, 2023 16:36
BRouter cars avoid
# *** The trekking profile is for slow travel
# *** and avoiding car traffic, but still with
# *** a focus on approaching your destination
# *** efficiently.
#
# *** Ta modyfikacja unika dróg z ograniczeniem
# *** prędkości powyżej 50 km/h oraz leśnych ścieżek
# *** niedostosowanych do ruchu rowerowego.
# ***
# ***
@onliniak
onliniak / trekking-avoid-steep.brf
Last active June 2, 2023 15:28
BRouter steep avoid
# *** The trekking profile is for slow travel
# *** and avoiding car traffic, but still with
# *** a focus on approaching your destination
# *** efficiently.
#
# *** Prędkość dostosowana do niewytrenowanego
# *** rowerzysty MTB. Nawigacja wybiera jak
# *** najłagodniejsze podjazdy. Lubi prowadzić
# *** drogami z przeciętnym ruchem samochodowym.
# *** Unika dróg "pomarańczowych" i "czerwonych".
@onliniak
onliniak / pnm2pdf.sh
Created September 14, 2022 21:23
XSane
gm convert *.pnm output.pdf
@onliniak
onliniak / demo.dart
Created May 12, 2022 22:05
Flutter RealWorld Demo
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
class Home extends StatelessWidget {
const Home({Key? key}) : super(key: key);
@override
@onliniak
onliniak / pdf.html
Created March 21, 2022 08:27
Czytnik PDF
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object
<object type="application/pdf"
data="/media/examples/In-CC0.pdf"
width="250"
height="200">
</object>