This file contains 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
Rebol [ | |
Title: "HTTPD Scheme" | |
Date: 27-Mar-2019 | |
Author: [ | |
"Oldes" 27-Mar-2019 "Rewritten Chris' HTTPD Scheme" | |
"Christopher Ross-Gill" 4-Jan-2017 "Adaptation to Scheme" | |
"Andreas Bolka" 4-Nov-2009 "A Tiny HTTP Server" | |
] | |
File: %httpd.r3 | |
Version: 0.3.0 |
This file contains 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
Red [ | |
Title: "Get Google Images" | |
Note: "Just an experiment:)" | |
Settings: [ | |
isz: [ ;- size | |
medium: "m" | |
large: "l" | |
] | |
itp: [ ;- type | |
"photo" |
This file contains 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
Red [] | |
whitespace: charset reduce [space tab cr lf] | |
ws: [any whitespace] | |
rule-object: [ | |
ws <purchaseObject> [ | |
ws <OKPD2> [ | |
ws <code> copy *cd to "<" </code> | |
ws <name> copy *nm to "<" </name> |
This file contains 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
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[ |
This file contains 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
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" |
This file contains 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
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 [] |
This file contains 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
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: ♠ & ¢ <a> and Δδ ¾} |
This file contains 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
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/ |
This file contains 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
Rebol [] | |
last-20-closed-issues: { | |
query($owner:String!,$repo:String!) { | |
repository(owner:$owner, name:$repo) { | |
issues(last:20, states:CLOSED) { | |
edges { | |
node { | |
title | |
url |
This file contains 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
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!" |