Skip to content

Instantly share code, notes, and snippets.

View Oldes's full-sized avatar

Oldes Huhuman Oldes

View GitHub Profile
@Oldes
Oldes / sort-versions.reb
Last active March 7, 2024 10:15
Sorts block of semantic versioning strings with applied Maven exceptions
Rebol [
Name: semantic-version
Type: module
Purpose: "Sorts block of semantic versioning strings with applied Maven exceptions"
Exports: [sort-versions compare-versions]
Usage: [
sort-versions ["2-alpha" "2.0" "1" "2-sp" "1.2" "2-beta" "2-rc1" "2-rc2"]
;== ["1" "1.2" "2-alpha" "2-beta" "2-rc1" "2-rc2" "2.0" "2-sp"]
]
Version: 1.0.0
@Oldes
Oldes / dmx-port.r3
Created March 6, 2024 20:47
Cross-platform DMX port usage example
Rebol [
Purpose: "Cross-platform DMX port usage example"
Needs: 3.11.0 ;= https://github.com/Oldes/Rebol3/releases/tag/3.11.0
]
;------------- DMX ------------------------
dmx-ctx: context [
ser: none
bin: make binary! 513 insert/dup bin 0 513
;- Channel 10A
@Oldes
Oldes / graph2d.r3
Last active March 24, 2023 18:37
Graphing 2D Equations using Rebol/MathPresso extension
REBOL [
title: "Graphing 2D Equations"
file: %graph2d.r3
purpose: {
Demonstrate use of Rebol/MathPresso extension.
Using precompiled math expression.
https://github.com/Siskin-framework/Rebol-MathPresso
}
reference: https://p5js.org/examples/math-graphing-2d-equations.html
license: MIT
@Oldes
Oldes / primitive-v2.reb
Last active March 23, 2023 23:50
Reproducing images with geometric primitives. Using curves.
REBOL [
Title: "Reproducing images with geometric primitives."
type: module
name: primitive
date: 24-Mar-2023
author: "Oldes"
version: 0.2.0
license: MIT
purpose: {This is a try to have something like this https://github.com/fogleman/primitive}
exports: [primitivize]
@Oldes
Oldes / primitive.reb
Last active March 23, 2023 15:22
Reproducing images with geometric primitives
REBOL [
Title: "Reproducing images with geometric primitives."
type: module
name: primitive
date: 22-Mar-2023
author: "Oldes"
version: 0.1.0
license: MIT
purpose: {This is a try to have something like this https://github.com/fogleman/primitive}
exports: [primitivize]
@Oldes
Oldes / new-rebx.r3
Created March 22, 2023 10:49
Rebol extension source code template generator
REBOL [
title: "Rebol extension source code template generator"
]
system/options/quiet: false
system/options/log/siskin: 3
;- File templates --------------------------------------------------------------
rebol-extension.r3: {REBOL [
title: "Rebol/#NAME# module builder"
type: module
@Oldes
Oldes / random-names.reb
Created December 27, 2022 11:55
Random names generator scheme
REBOL [
Title: "Random names"
type: module
name: random-names
version: 0.0.1
author: @oldes
exports: [random-names]
]
;; https://britishsurnames.co.uk/random
@Oldes
Oldes / my-ip.r3
Created April 10, 2022 12:57
Resolve external IP address
Rebol []
my-ip?: function[
"Resolves external IP address"
][
quiet: system/options/quiet
system/options/quiet: true
host-name: read dns://
local-ip: read join dns:// host-name
external-ip: read http://ifconfig.me/ip
system/options/quiet: quiet
@Oldes
Oldes / TLS-Chacha20-Poly1305-simulation.r3
Last active January 27, 2022 22:36
TLS with ChaCha20-Poly1305 use-case simulation
Rebol [
title: "TLS with ChaCha20-Poly1305 use-case simulation"
needs: 3.8.0
]
print "--------------------------------------------------"
print "- TLS with ChaCha20-Poly1305 use-case simulation -"
print "--------------------------------------------------"
@Oldes
Oldes / timelaps-anim.reb
Created January 6, 2021 22:27
Making timelaps webp or gif anim
Rebol [
purpose: {notes how to make timelaps animation}
]
;- OpenCV's stitching_detailed.exe to prepare timelaps images
cmd {stitching_detailed --try_cuda yes --warp transverseMercator --timelapse crop 01.jpg 02.jpg}
;- https://developers.google.com/speed/webp/download
cmd {img2webp -lossy -d 300 fixed_01.jpg fixed_02.jpg -o out.webp}