Skip to content

Instantly share code, notes, and snippets.

@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[
@Oldes
Oldes / parse-purchase.red
Last active January 30, 2020 08:06
Just a parse example.
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>
@Oldes
Oldes / get-google-images.red
Last active June 10, 2019 19:54
Retrieve image urls from Google search
Red [
Title: "Get Google Images"
Note: "Just an experiment:)"
Settings: [
isz: [ ;- size
medium: "m"
large: "l"
]
itp: [ ;- type
"photo"
@Oldes
Oldes / httpd.reb
Last active March 27, 2019 17:56 — forked from rgchris/httpd.reb
An HTTPD Scheme for Rebol 3 [Experimental]
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
@Oldes
Oldes / StringCache.c
Created February 27, 2019 16:46
StringCache
https://gitter.im/blend2d/b2d?at=5c76b021e8ea143737842e2f
struct StringCache {
#define ENTRY(ID, NAME, CONTENT) \
struct NAME { \
enum { kId = ID }; \
char str[sizeof(CONTENT)] = CONTENT; \
}
ENTRY(0, id, "id");
};
@Oldes
Oldes / typed-array.reds
Created September 8, 2017 15:09
typed-array
Red/System [
title: "Typed array"
purpose: "Low level struct for holding typed data"
]
#enum typed-array-types! [
TYPE_FLOAT32!: 1
]
typed-array!: alias struct! [
@Oldes
Oldes / julia.reds
Last active June 9, 2017 14:26
Red/System libjulia binding
Red/System [
Title: "Red/System libjulia binding"
Author: "Oldes"
File: %Julia.reds
Tabs: 4
Rights: "Copyright (C) 2017 Oldes. All rights reserved."
License: {
Distributed under the Boost Software License, Version 1.0.
See https://github.com/red/red/blob/master/BSL-License.txt
}
@Oldes
Oldes / SQLite3.reds
Last active April 12, 2017 20:09
SQLite3 Red/System binding
Red/System [
Title: "Red/System SQLite3 binding"
Author: "Oldes"
File: %SQLite3.reds
Rights: "Copyright (C) 2017 David 'Oldes' Oliva. All rights reserved."
License: "BSD-3 - https:;//github.com/red/red/blob/master/BSD-3-License.txt"
]
#switch OS [
@Oldes
Oldes / tb.red
Last active December 18, 2015 16:03
Drag and drop issue test
Red [
"Drag and Drop test"
filename: %tb.red
author: "Oldes"
version: 0.6.0
date: "18-Dec-2015"
Needs: 'View
]
system/view/debug?: no