This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
Description: "Yet another color-picker" | |
Date: 9-May-2019 | |
] | |
context [ | |
colors: [] | |
colors2: [pen off translate 260x280 []] | |
i: 9 | |
j: 256 / (i - 1) | |
img: none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
Author: "Toomas Vooglaid" | |
Date: 13-Feb-2019 | |
Purpose: {Example of dragging words from area to text-list} | |
] | |
count-nl: func [face /local text n x][ | |
n: 0 x: face/selected/x | |
text: copy face/text | |
while [all [ | |
text: find/tail text #"^/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
Purpose: "PoC script for checking if brackets/parens are matching in a Red file" | |
] | |
check-brackets: function [file [file!]][ | |
line: 1 | |
stack: clear [] | |
skip-chars: complement charset "[]()^/" | |
parse read file [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
Author: "Toomas Vooglaid" | |
Date: 27-11-2017 | |
] | |
lazy-range: function [ | |
"Returns function that generates next value in (possibly infinite) range" | |
val [scalar!] "Initial value" | |
/step stp [scalar! block!] "By which to increment each next value" | |
/limit lim [integer!] "How many new values to generate" | |
/stop stopval [scalar! block!] "On which value to stop generation of new values; if block, then also after how may matches" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
collect-values: function [ | |
"Collect values in a block, by type or custom parse rule" | |
block [block!] | |
rule "Datatype, prototype value, or parse rule" | |
/deep "Include nested blocks" | |
/local v | |
][ | |
rule: switch/default type?/word rule [ | |
datatype! [reduce [rule]] ; Turn a plain datatype into a parse rule for that type. | |
block! typeset! [:rule] ; Blocks and typesets (e.g. any-word!) work directly as rules. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Embedding Elm in HTML!</title> | |
<script type="text/javascript" src="elm.js"></script> | |
</head> | |
<body> | |
<h1>Stamper</h1> | |
<div id="stamper" style="width:50%; height:400px;"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
All of these resources were extremely valuable as I researched regex, finite state machines, and regex in Ruby. Check them out, they're full of fantastic information! | |
Articles | |
"Exploring Ruby's Regular Expression Algorithm" by Pat Shaughnessy | |
http://patshaughnessy.net/2012/4/3/exploring-rubys-regular-expression-algorithm | |
"Finite State Machines and Regular Expressions" by Eli Bendersky | |
http://www.gamedev.net/page/resources/_/technical/general-programming/finite-state-machines-and-regular-expressions-r3176 | |
"Regular Expression Matching Can Be Simple and Fast" by Russ Cox |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I wanted to try this. | |
So I added new line. |