Skip to content

Instantly share code, notes, and snippets.

View dockimbel's full-sized avatar

Nenad Rakocevic dockimbel

View GitHub Profile
@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 [
@toomasv
toomasv / l-system.red
Last active February 21, 2019 12:11
Experiments with L-System
Red [
Author: "Toomas Vooglaid"
Date: 25-9-2017
Description: {Experiments with L-System}
Last-update: 26-9-2017
Uses: {%models.red https://gist.github.com/toomasv/313e1d8583fb159428222651b76926cd}
Repo: https://github.com/toomasv/l-system
]
context [
ctx: self
@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.
@PeterWAWood
PeterWAWood / calculator.red
Last active September 15, 2017 07:18
A test of Red's native look and feel
Red[
Title: "Calculator"
Author: "Peter W A Wood"
File: %calculator.red
Purpose: "A mac-like calculator to test native look and feel"
Tabs: 4
Rights: "Copyright (C) 2017 Peter W A Wood. All rights reserved."
License: {
Distributed under the Boost Software License, Version 1.0.
See https://github.com/red/red/blob/master/BSL-License.txt
@toomasv
toomasv / chatbot.red
Last active September 12, 2017 08:39
Red [
Original: "Gregg Irwin"
Source: https://gitter.im/red/help?at=59b3040566c1c7c4772d4172
Purpose: "Toy chatbot about Red functions"
Needs: "info.red (https://gist.github.com/toomasv/eaac3829ac5e745f43121aa60b555d68)"
]
; See: http://www.red-lang.org/2016/03/060-red-gui-system.html blog entry
; Lots of name choices to consider.
@toomasv
toomasv / matrix.red
Last active October 6, 2017 10:52
Little matrix DSL
Red [
Author: "Toomas Vooglaid"
Date: 7-9-2017
Last-update: 4-10-2017
]
mx: context [
ctx: self
mtx: object [
rows: cols: data: none
get-col: func [col][extract at data col cols]
@honix
honix / let.red
Last active September 5, 2017 15:24
Red []
let: func [
binds
block
/local
ctx
][
ctx: context append/only append binds copy [result: do] block
select ctx 'result
Red [
Needs: 'View
]
dangle: pi / 255
pi2: pi * 2
angle: 0.0
radius: 200
buffer: make image! 500x500
Red [
author: { Maxim Velesyuk }
description: {
colors palette showcase
}
]
sys-words: words-of system/words
colors: copy []
forall sys-words [
@rebolek
rebolek / join.red
Last active February 7, 2018 10:11
Red[]
join: func [
"Reduce values in a block and joins them into a string"
block [block!]
/with "Add delimiter between values"
delimiter
/trim "Remove NONE values"
] [
if empty? block [return ""]