Skip to content

Instantly share code, notes, and snippets.

View iArnold's full-sized avatar

iArnold iArnold

  • Freelance ICT Specialist
  • Netherlands
View GitHub Profile
@iArnold
iArnold / maskinput
Last active November 4, 2016 13:37
Masked input
Red [
filename: %maskinput.red
date: "4-Nov-2016"
Needs: 'View
]
star-replace: func [
num
/local stars
][
@iArnold
iArnold / tabtest.red
Created October 18, 2016 11:00
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!"
@iArnold
iArnold / JSON.red
Created October 6, 2016 19:46 — forked from rebolek/JSON.red
JSON toy parser for Red
Red [
Title: "JSON parser"
File: %json.red
Author: "Nenad Rakocevic"
License: "BSD-3 - https://github.com/red/red/blob/master/BSD-3-License.txt"
]
json: context [
quoted-char: charset {"\/bfnrt}
exponent: charset "eE"
Red [
Title: "Conway's Game of Life"
Needs: 'View
]
grid: collect [repeat i 50 [keep/only collect [repeat j 50 [keep random true]]]]
scratchgrid: collect [repeat i 50 [keep/only collect [repeat j 50 [keep false]]]]
a: copy grid/1
b: copy grid/50
@iArnold
iArnold / *-while.red
Created September 12, 2016 06:46 — forked from greggirwin/*-while.red
Various <action>-while example funcs for Red.
; A number of languages have `take-while/drop-while` funcs. This is just to show how you
; can build them in Red.
; This model can be applied to any function that has a `/part` refinement, or extended in
; any number of ways. We don't yet have a standard `apply` or `refine` function in Red.
; Once we do, a more general HOF version could take the action as an arg, as well as the
; test to apply.
; Should this return the position, like FIND, rather than an integer?
; No match would then mean a NONE result. REMOVE/TAKE/COPY with /PART
@iArnold
iArnold / Livecode enhanced
Created September 9, 2016 14:36 — forked from DideC/Livecode enhanced
Based on Dockimbel VID livecode, this is a little more advanced version where you can define Red's values used by the VID code. And the window is resizable.
Red [
Title: "Simple GUI livecoding demo"
Author: "Nenad Rakocevic / Didier Cadieu"
File: %livecode2.red
Needs: 'View
Usage: {
Type VID code in the bottom right area, you will see the resulting GUI components
rendered live on the left side and fully functional (events/actors/reactors working live).
The top right area let you define Red's values to be used in your VID code, even functions or anything.
}
@iArnold
iArnold / Redcompiler.r
Created June 23, 2016 20:25
Compiler R2 front end for compiling Red programs
REBOL [
Title: "Red compiler and Runner"
File: %redcompiler.r
Date: 04-Dec-2012
Author: ["Arnold van Hofwegen"]
Purpose: "GUI to help with compile and run your Red(/System) scripts."
Comment: {
29-Nov-2012 Mods and comments by Gregg Irwin.
04-Dec-2012 Added check for red.r in the directory
Added --red-only compile option
@iArnold
iArnold / sparks.red
Last active June 20, 2016 14:55
Sparks with a twist
Red [
Title: "Sparks demo"
Author: "Qingtian Xie"
File: %sparks.red
Tabs: 4
Needs: View
]
system/view/auto-sync?: no
@iArnold
iArnold / one-planet.red
Created June 15, 2016 12:10
Circle around
Red [
Title: "Planet orbits a star"
file: %one-planet.red
Author: "Arnold van Hofwegen"
needs: view
]
cycle: make block! 361
repeat i 360 [append cycle i]
append cycle 1
@iArnold
iArnold / image-noise.red
Created May 13, 2016 12:08
Random noise image
Red [
Author: ["Martin Ceronio" "Nenad Rakocevic" "Arnold van Hofwegen"]
Needs: 'View
]
system/view/auto-sync?: no
break-loop: false
i: make image! 50x50