Skip to content

Instantly share code, notes, and snippets.

View dockimbel's full-sized avatar

Nenad Rakocevic dockimbel

View GitHub Profile
@greggirwin
greggirwin / greggs-mezz.red
Last active June 21, 2018 18:54
A bunch of general purpose mezzanine funcs for Red.
Red [
File: %greggs-mezz.red
Author: "Gregg Irwin"
Purpose: "An interim mezzanine dump, while Red is still moving fast."
Tabs: 4
Comment: {
Not everything here has been well-tested or, well, tested. Most
of the functions are ports from R2, with many more to come. I'm
combining everything in one file for ease of experimentation, so
you don't have to worry about includes or dependencies with the
@greggirwin
greggirwin / arity-of.red
Last active April 12, 2021 17:47
Red arity-of function
; We have other reflective functions (words-of, body-of, etc.), but
; this is a little higher level, sounded fun to do, and may prove
; useful as we write more Red tools. It also shows how to make your
; own typesets and use them when parsing.
arity-of: function [
"Returns the fixed-part arity of a function spec"
spec [any-function! block!]
/with refs [refinement! block!] "Count one or more refinements, and add their arity"
][
@greggirwin
greggirwin / vid-pico-sheet.red
Last active August 19, 2017 15:13
VID version of Nenad's Native Red PicoSheet
Red [
Title: "Tiny VID Spreadsheet"
Author: ["Gregg Irwin" "based on Nenad's Native PicoSheet"]
Needs: View
]
sheet-size: 8x8
cell-size: 100x24
L: charset "ABCDEFGHIabcdefghi"
REBOL []
src: read %lizard.svg
transparent: 0.0.0.255
;** Stack operations
pile: tail reduce [copy [pen transparent]] ;** by default, no pen color
rollback: does [pile: back pile]
@greggirwin
greggirwin / vector-balls.red
Last active July 8, 2016 09:29
Red Vector Balls
Red [
Title: "Vector Balls Demo"
Author: ["Nenad Rakocevic" "Gregg Irwin"]
Date: "[2-feb-2001 15-jun-2016]"
File: %vector-balls.red
Version: 0.4
History: {[
0.2 12-jun-2000 "First version released."
0.3 02-feb-2001 "Speed field added"
0.4 26-jun-2016 "Ported to Red by Gregg"
@greggirwin
greggirwin / view-hanoi.red
Last active December 14, 2016 05:51
Graphical Red Towers of Hanoi
Red [
File: %view-hanoi.red
Author: "Gregg Irwin"
Date: "4-Oct-2001 — 26-Jun-2016"
Needs: View
]
num-disks: 5 ; Have to set this here until it gets into the UI.
disk-height: 15
disk-cell-width: 20 ; Smallest disk is 1 cell wide
@greggirwin
greggirwin / resize-image.red
Created June 19, 2016 19:30
Red interactive image resizing demo
Red [
Title: "Draw Image Resizing Test"
Author: [REBOL version "Carl Sassenrath" Red port "Gregg Irwin"]
Version: 0.0.1
Needs: View
]
distance: func [pos [pair!]][square-root add pos/x ** 2 pos/y ** 2]
grab-size: 5
@greggirwin
greggirwin / fill-pen-lab.red
Created June 18, 2016 02:55
Fill-pen Lab for Red
Red [
Title: "Fill-pen Lab"
Author: "Gregg Irwin"
File: %fill-pen-lab.red
Needs: View
]
to-color: function [r g b][
color: 0.0.0
if r [color/1: to integer! 256 * r]
@greggirwin
greggirwin / paint.red
Last active February 8, 2018 18:28
Red Paint (World's smallest paint program)
Red [
title: "Paint"
Author: [REBOL version "Frank Sievertsen" Red port "Gregg Irwin"]
File: %paint.red
Tabs: 4
Needs: View
version: 0.0.2
]
draw-blk: copy []
@greggirwin
greggirwin / bubbles.red
Last active June 17, 2016 23:23
Animated bubbles
Red [
Title: "Bubbles"
Author: [REBOL version "Gabriele Santilli" Red port "Gregg Irwin"]
File: %bubbles.red
Tabs: 4
Needs: View
]
system/view/auto-sync?: no