Skip to content

Instantly share code, notes, and snippets.

View Oldes's full-sized avatar

Oldes Huhuman Oldes

View GitHub Profile
@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}
@Oldes
Oldes / enlist.r3
Last active October 31, 2020 22:48
Rebol [
name: enlist
purpose: "Format series to human readable list"
usage: [
print enlist [] ;= none
print enlist [1] ;= just 1
print enlist [1 2] ;= 1 and 2
print enlist [1 2 3] ;= 1, 2 and 3
]
note: https://gitter.im/red/help?at=5f9c02f906fa0513dd8119d1
@Oldes
Oldes / png-size.r3
Last active October 30, 2020 23:43
Read PNG size from raw binary data
Rebol [
name: png-size
needs: 3.2.0
usage: [
png-size http://avatars-04.gitter.im/gh/uv/4/oldes
]
]
png-size: func[
"Read PNG size from raw binary data"
@Oldes
Oldes / SoundRAW
Last active October 14, 2020 03:41
SoundRAW loop
package core
{
import display.TimelineMemoryBlock;
import flash.events.SampleDataEvent;
import flash.media.Sound;
import avm2.intrinsics.memory.*;
/**
* ...
* @author Oldes
@Oldes
Oldes / github.r3
Created May 25, 2020 10:52
Simple Github API context
Rebol [
title: "Github API"
author: "Oldes"
license: MIT
]
My-GitHub-authorization: "token ..." ;<--- replace ... with your API token!
github: context [
api.github: https://api.github.com/
@Oldes
Oldes / html-entities.red
Last active May 13, 2020 10:05
HTML entities
Red [
Title: "HTML entities"
Purpose: "To decode HTML entities in a text"
Author: "Oldes"
Date: 12-May-2020
Version: 1.0.2
License: MIT
Usage: [
"Test: ♠ & ¢ <a> and Δδ ¾" =
decode-html-entities {Test: &spades; & &#162; &lt;a&gt;&#32;and &Delta;&delta; &frac34;}
@Oldes
Oldes / func-spec.r3
Created April 16, 2020 08:56
Gregg's parse-func-spec function for Rebol3
Rebol [
note: {There are some hacks in this, based on empirical testing.}
]
func-spec-ctx: context [
func-spec: context [
desc: none
attr: none
params: copy []
refinements: copy []
@Oldes
Oldes / tcp-bug-test.r3
Created April 6, 2020 14:07
Gabriele's TCP bug test script
REBOL [ ]
listen: open tcp://:8080
port: open tcp://localhost:8080
start: 0
listen/awake: func [event] [
;print "Listen Awake"
switch/default event/type [
accept [
;print "Accept"
@Oldes
Oldes / GitHub-graphql-request.red
Last active February 14, 2020 09:47
GitHub's GraphQl request test
Red [
title: "GitHub's graphql request test"
author: "Oldes"
reference: https://developer.github.com/v4/
]
;@@ https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/
graphql-header: [Authorization: "token YOUR_OAUTH_TOKEN_HERE"]
graphql-request: func[