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 / graphql-requests.reb
Created May 25, 2020 10:56
Some useful GraphQL queries
Rebol []
last-20-closed-issues: {
query($owner:String!,$repo:String!) {
repository(owner:$owner, name:$repo) {
issues(last:20, states:CLOSED) {
edges {
node {
title
url
@Oldes
Oldes / wait-for-key.r3
Last active July 30, 2023 15:56
Simple Rebol `wait-for-key` function.
Rebol [
name: wait-for-key
title: "Simple Rebol `wait-for-key` function"
purpose: "Demonstrate how to get simple user keyboard input from console without need to press ENTER"
author: "Oldes"
date: 7-Jun-2020
needs: 3.8.0 ; https://github.com/Oldes/Rebol3
note: "So far works only on Windows!"
usage: [
print "Press any key!"
@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 / 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 / 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