Skip to content

Instantly share code, notes, and snippets.

Gregg Irwin greggirwin

  • FullStack Technologies
Block or report user

Report or block greggirwin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
greggirwin /
Created Aug 5, 2019
Red Load-Time and Type Tally
Red [
purpose: {
Load a Red file, noting how long it takes to do so,
then parse it and tally all the values by datatype.
It's not a metric that may prove useful, but in
aggregate, we could see what types are most commonly
I'll correct my own thinking. After just a few sample
greggirwin /
Last active Sep 1, 2019
VID across/below alignment demo
Red []
view [
style chk: check "Option" data yes
style vline: base 2x60 red
across top vline button "Ok" text "Text" field chk return
across middle vline button "Ok" text "Text" field chk return
across bottom vline button "Ok" text "Text" field chk
View r2-mapping-lib.r
;!! This is very much a work in progress, with many things untested. It needs
; to be clear what is functional and break out R&D bits into a working script
; for that purpose.
Arcsin: func [X [decimal!]] [
;'Arcsin(X) = Atn(X / Sqr(-X * X + 1)) [from MS Help - VB4, 1995]
Re: WRT: func ['name content][]
WRT incr {
The most common case will be to change state, but incr does add meaning, and has
benefits, in my mind, when used with scalars.
- By default, there is no step value, so you can't get the + 1 part wrong.
- Incr is often used when looping, making loop variables stand out from other add
ops that might be in expressions.
greggirwin /
Last active Oct 24, 2018
RFC3986 URL parser and separate tests
Red []
test-urls: reduce [
foo:// ; no path
object [
scheme: 'foo
user-info: none
host: "" ; none ; this is tricky, the // means we'll always have a host, even if empty.
greggirwin /
Last active Aug 14, 2019
Red URL Parser (now included in Red: %environment/
Red [
title: "RFC3986 URL parser"
author: "@greggirwin"
date: 03-Oct-2018
notes: {
Most rule names are taken from the RFC, with the goal of
making it easy to compare to the reference. Some rules
greggirwin /
Last active Mar 4, 2020
INJECT func experiment. Alternative to REDUCE or COMPOSE.
Red [
name: 'inject
author: "Gregg Irwin"
notes: {
Red version of Ladislav Mecir's R2 `build` func. I can't find his on
the net, to link to, but can post his original if desired. His point
was that `compose` isn't always easy to use, when parens are part of
block you're composing, or how your blocks are structured, whether you
can use `/only` with `compose`. e.g.
greggirwin /
Created Aug 8, 2018
Red JOIN/COMBINE mezzanine ideas
Red []
; TBD: pair tuple
combine: func [
"Merge values, modifying a if possible"
a "Modified if series or map"
b "Single value or block of values; reduced if `a` is not an object or map"
if all [block? :b not object? :a not map? :a] [b: reduce b]
case [
win: layout [
title "VID test"
text "Hello"
button "Hello" 100x40 [bar/data: random 100%]
button "World"
button "China"
text "Red Language" 100 right
greggirwin /
Last active Jul 28, 2018 — forked from toomasv/
Bezier `curve`-based tweening
Red [
Author: "Toomas Vooglaid"
Date: 2018-07-27
Purpose: {Study of bezier-based tweens}
Needs: 'View
down-flags: [down1? down2? down3? down4? b1-down? b3-down?] ;down?
clear-down-flags: does [set down-flags off]
You can’t perform that action at this time.