Skip to content

Instantly share code, notes, and snippets.

@DideC
DideC / animate.red
Created Feb 26, 2018
First try of an animation dialect for Red VID. Computation is not precise enough, but just a proof of concept ;-)
View animate.red
Red [
Purpose: "Animation system for VID"
Needs: 'View
Notes: {
Simplyfied Ease in/out formulas : http://gizma.com/easing/#l
See at the end of page source for javascripts formulas (included elastic) : http://easings.net/en
}
]
@DideC
DideC / logo.red
Last active Feb 23, 2018 — forked from rebolek/logo.red
Live logo
View logo.red
Red[]
dst: [
pen 238.172.41
fill-pen 238.172.41 polygon 100x2 114x56 72x43
fill-pen 188.130.45 polygon 100x2 114x56 128x38
pen 212.28.24
fill-pen 212.28.24 polygon 118x72 132x128 36x96 64x54
fill-pen 129.31.34 polygon 118x72 132x128 169x88 135x48
@DideC
DideC / red-basic-editor.red
Last active Jan 25, 2017
A very basic text editor in VID. Handling only load and save of a file. Needs `call` to handle compilation and test of script
View red-basic-editor.red
Red [
title: "Red basic Editor"
author: "Didier Cadieu"
version: 0.1.1
date: "25-01-2017"
]
script: make string! 10000
saved?: true
@DideC
DideC / heart-animation.red
Last active Jan 30, 2017
Heart animation for Red (only). New parameters added to the (reordered) control panel to play with the animation + credits. Nice time eater ;-)
View heart-animation.red
Red [
title: "Heart animation"
author: "Didier Cadieu"
notes: {
Traduction in Red of Terebus Volodymyr javascript demo : http://codepen.io/tvolodimir/pen/wqKuJ
}
Needs: View
]
;*** Settings
@DideC
DideC / focus.red
Created Oct 19, 2016
Tiny VID utility func and test (find-window, focus)
View focus.red
Red [
title: "Test of `find-window and `focus funcs"
author: "Didier Cadieu"
]
find-window: func [
"Find a face's window face."
face [object!]
][
while [face/parent] [face: face/parent]
@DideC
DideC / dt.red
Created Oct 7, 2016
Small func to compute running time of a Red/Rebol code
View dt.red
Red [
title: "Compute the time taken to run a code a number of times."
author: "Didier Cadieu"
]
dt: func [n [integer!] code [block!] /local st] [
st: now/time/precise
loop n code
print [n "loops in" st: now/time/precise - st " => one in" st / n]
]
@DideC
DideC / roman-to-from-arabic.red
Last active Oct 7, 2016
Conversion between Arabic and Roman numbers in Red
View roman-to-from-arabic.red
Red [
Purpose: "Arabic <-> Roman numbers converter"
Author: "Didier Cadieu"
Date: "07-Oct-2016"
]
; Lookup tables for conversion
table-r2a: reverse copy table-a2r: [1000 "M" 900 "CM" 500 "D" 400 "CD" 100 "C" 90 "XC" 50 "L" 40 "XL" 10 "X" 9 "IX" 5 "V" 4 "IV" 1 "I"]
roman-to-arabic: func [r [string!] /local a b e] [
@DideC
DideC / Livecode enhanced
Last active Feb 20, 2018
Based on Dockimbel VID livecode, this is a little more advanced version where you can define Red's values used by the VID code. The window is resizable and there is spliters to rearange space.
View Livecode enhanced
Red [
Title: "Simple GUI livecoding demo"
Author: "Nenad Rakocevic / Didier Cadieu"
File: %livecode.red
Version: 1.2.1
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.
@DideC
DideC / sparks.red
Last active Jun 15, 2016 — forked from qtxie/sparks.red
With just a little bit of colored sparks
View sparks.red
Red [
Title: "Sparks demo"
Author: "Qingtian Xie"
File: %sparks.red
Tabs: 4
Needs: View
]
system/view/auto-sync?: no
@DideC
DideC / analog-clock.red
Created Jun 15, 2016 — forked from greggirwin/analog-clock.red
An analog clock for Red
View analog-clock.red
Red [
Title: "Red O'clock"
Author: "Gregg Irwin"
]
degree-to-xy: func [rad "radius" deg "degrees"] [
as-pair (rad * sine deg) (rad * negate cosine deg)
]
sex-to-degree: func ["Sexagesimal to degrees" n] [n * 6]
You can’t perform that action at this time.