Skip to content

Instantly share code, notes, and snippets.

View rebolek's full-sized avatar

Boleslav Březovský rebolek

  • 06:07 (UTC +02:00)
View GitHub Profile
@rgchris
rgchris / httpc.red
Last active December 17, 2018 08:40
HTTPC in Red
#!/usr/local/bin/red
Red [
Title: "HTTP Console"
Date: 15-Dec-2018
File: %httpc.red
Version: 0.1.2
Author: "Christopher Ross-Gill"
History: [
15-Dec-2018 0.1.2 "Red Version"
@toomasv
toomasv / regex.red
Last active November 20, 2017 18:22
Regex to parse translator
Red [
Author: "Toomas Vooglaid"
file: "%regex.red"
Purpose: {Regex to parse converter}
History: {Started: 2017-05-09
v.0.1: 2017-05-12 -- first working version with:
start `^^` and end `$` anchors,
non-capturing groups (one level) with alterns,
quantifiers (possessive),
some character-classes.
@toomasv
toomasv / matrix.red
Last active October 6, 2017 10:52
Little matrix DSL
Red [
Author: "Toomas Vooglaid"
Date: 7-9-2017
Last-update: 4-10-2017
]
mx: context [
ctx: self
mtx: object [
rows: cols: data: none
get-col: func [col][extract at data col cols]
@meijeru
meijeru / arith.txt
Last active September 6, 2017 15:36
Types of artihmetic operations
Updated to Red for Windows version 0.6.2 built 7-Jun-2017/15:13:57+2:00
The table gives type of first operand, type of second operand, result type
for + (add), - (subtract), * (multiply), / (divide), // (modulo) and % (remainder)
For vectors, the element type is distinguished.
There is one case (time with time) where the result type is not the same
for all allowed operations.
After each type combination, the reverse combination is given.
The fourth column gives the operators for which the combination is forbidden.
If the result type is error, the combination is forbidden for all operators.
@gchiu
gchiu / mini-http.r3
Last active December 18, 2015 16:29
mini-http
rebol []
; mini-http is a minimalistic http implementation
mini-http: funct [url [url!] method [word! string!] code [string!] timeout [integer!]
/callback cb
/cookies cookie [string!]
] [
url-obj: http-request: payload: result: port: none
make object! [
; Private Unicode Area for encoded delimiters and octets
url-pua-start: #"^(e000)"
url-pua-end: #"^(e0ff)"
delimiter: charset ":/?#[]@!$&'()*+,;="
hex-digit: charset [#"0" - #"9" #"a" - #"f" #"A" - #"F"]
ascii: charset [#"^(00)" - #"^(7f)"]