Skip to content

Instantly share code, notes, and snippets.

View rebolek's full-sized avatar

Boleslav Březovský rebolek

  • 14:19 (UTC +02:00)
View GitHub Profile
@rebolek
rebolek / JSON.red
Last active March 5, 2017 19:13 — forked from dockimbel/JSON.red
FIX: Keywords can contain space
Red [
Title: "JSON parser"
File: %json.red
Author: "Nenad Rakocevic, Qingtian Xie, Boleslav Březovský"
License: "BSD-3 - https://github.com/red/red/blob/master/BSD-3-License.txt"
]
json: context [
quoted-char: charset {"\/bfnrt}
exponent: charset "eE"
@rebolek
rebolek / tabtest.red
Last active October 18, 2016 16:35 — forked from iArnold/tabtest.red
How to go about adding tab functionality?
;do %/c/../tabtest.red ;-- Everything before the Red header is not a comment!!
Red [
file: %tabtest.red
]
window-actors: object [ ;-- actors for the window
on-key: func [face [object!] event [event!]][
case [
event/key = #"^-" [
print "TAB key caught by window face!"
@rebolek
rebolek / VID.red
Last active December 8, 2016 02:19
Red [
Title: "View Interface Dialect"
Author: ["Nenad Rakocevic" "Boleslav Březovský"]
File: %VID.red
Tabs: 4
Rights: "Copyright (C) 2014-2016 Nenad Rakocevic. All rights reserved."
License: {
Distributed under the Boost Software License, Version 1.0.
See https://github.com/dockimbel/Red/blob/master/BSL-License.txt
}
@rebolek
rebolek / github.red
Created March 5, 2017 05:49
testing gist desc
Red []
do %json.red
github: context [
; --- internal support functions
decode: function [data] [
first json/decode third data
@rebolek
rebolek / json.red
Created March 5, 2017 07:12
testing gist desc
Red [
Title: "JSON parser"
File: %json.red
Author: "Nenad Rakocevic, Qingtian Xie"
License: "BSD-3 - https://github.com/red/red/blob/master/BSD-3-License.txt"
]
json: context [
quoted-char: charset {"\/bfnrt}
exponent: charset "eE"
@rebolek
rebolek / github.red
Last active March 6, 2017 16:44
Commit to repo works
Red [
Title: "GitHub API implementation"
Author: "Boleslav Březovský"
Date: "5-3-2017"
]
do %json.red
map-each: function [
'word ; NOTE: leaks word
Red [
Title: "Gitter API"
Author: "Boleslav Březovský"
File: %gitter-api.red
Rights: "Copyright (C) 2016 Boleslav Březovský. All rights reserved."
License: {
Distributed under the Boost Software License, Version 1.0.
}
Date: "23-10-2016"
Note: {
Red [
Title: "CSV Parser"
Author: "Boleslav Březovský"
Date: "21-3-2017"
Rights: "Copyright (C) 2017 Boleslav Březovský. All rights reserved."
License: "BSD-3 - https://github.com/red/red/blob/master/BSD-3-License.txt"
]
load-csv: function [
data [string! file! url!] "Text CSV data to load"
Red [
Title: "CSV Handling Tools"
Author: "Brian Hawley"
File: %csv-tools.r
Date: "20-Dec-2011"
Version: 1.1.5
Purpose: "Loads and formats CSV data, for enterprise or mezzanine use."
Library: [
level: 'intermediate
platform: 'all
Red []
convert-codepage: function [
data
] [
rule: copy []
output: copy []
data: skip data 17
foreach value data [
value: split value tab