Skip to content

Instantly share code, notes, and snippets.

View koba-yu's full-sized avatar

Koba-yu koba-yu

View GitHub Profile
@toomasv
toomasv / zooming.red
Last active September 5, 2019 16:32
Zooming function
Red [
Date: 4-Sep-2019
Description: {Mouse sensitive zooming function}
Author: "Toomas Vooglaid"
Licence: "Public domain"
]
zooming: function [face event][
;face's draw-block needs to have matrix defined
mx: face/draw/matrix
@toomasv
toomasv / date-picker.red
Last active May 17, 2019 09:59
To pick a date...
Red [
Started: 2018-05-16
Date: 2019-01-25
Needs: View
;%range.red ;https://gist.github.com/toomasv/0e3244375afbedce89b3719c8be7eac0
;TinyURL https://tinyurl.com/y7bt2nqy
File: %date-picker.red
]
context [
y: d: none
@toomasv
toomasv / graph.red
Last active July 11, 2018 02:22
Toy graph DSL
Red [
Author: "Toomas Vooglaid"
Date: 2017-12-31
History: [
2017-12-28 {First draft}
2018-01-20 {Added arrows, subtree moving, elementary interactive editing}
2018-01-24 {Edges formatting}
2018-02-01 {Added differnt edge-ends, layout orientations, improved options-handling}
2018-02-03 {Implemented stepped (orthogonal) edges, improved star layout}
2018-02-06 {Added directions `across` (default: perpendicular to the step-away direction) and `away` (in the step-away direction).
@mikeyaunish
mikeyaunish / Livecode-enhanced.red
Created December 7, 2017 05:29
Based on Dockimbel and Didier VID livecode. Added saving and loading of files and window configuration. Make VID updates controllable.
Red [
Title: "Simple GUI livecoding demo"
Author: "Nenad Rakocevic / Didier Cadieu / Mike Yaunish"
File: %livecode-enhanced.red
Version: 1.3.0
Needs: 'View
Usage: {
Type VID code in the bottom left area, you will see the resulting GUI components
rendered live on the right side and fully functional (events/actors/reactors working live).
The top left area lets you define Red's values to be used in your VID code, even functions or anything.
@dander
dander / generators.red
Last active August 27, 2020 07:29
An experiment to make a general purpose generator-creating function
Red [
Title: "generator function experiments"
Author: "Dave Andersen"
Date: 27-Sep-2017
]
reload: does [do system/options/script]
; @JacobGood's closure func
closure1: func [
@maximvl
maximvl / abc-score.red
Last active September 27, 2017 03:59
abc score for Red code
Red [
author: {Maxim Velesyuk}
usage: {
abc-score? <block of code>
abc-score? %file.red
abc-score? :some-function
}
description: {
The ABC software metric defines an ABC score as a triplet of values that represent the size of a set of source code statements.
An ABC score is calculated by counting the number of assignments (A), number of branches (B), and number of conditionals (C) in a program.
@greggirwin
greggirwin / nsource.red
Last active June 13, 2017 05:27 — forked from rebolek/nsource.red
Provides source of Red native functions
Red [
Title: "Nsource - native source"
Purpose: "Print source for native functions"
Author: "Boleslav Březovský"
Date: "8-6-2017"
]
indent: func [
"(Un)indent text by tab"
string [string!] "Text to (un)indent"
@rebolek
rebolek / nsource.red
Last active June 19, 2019 20:11
Provides source of Red native functions
Red [
Title: "Nsource - native source"
Purpose: "Print source for native functions"
Author: "Boleslav Březovský"
Date: "8-6-2017"
]
indent: func [
"(Un)indent text by tab"
string [string!] "Text to (un)indent"
@PeterWAWood
PeterWAWood / typing.red
Last active February 12, 2019 20:55
Entering text into Notepad from Red
Red []
#system [
chr: 1
handle: 0
KEYDOWN: 0
KEYUP: 2
minus-one: -1
pointer-to-minus-one: :minus-one
rs-phrase: ""
@DideC
DideC / heart-animation.red
Last active January 30, 2017 10:37
Heart animation for Red (only). New parameters added to the (reordered) control panel to play with the animation + credits. Nice time eater ;-)
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