Skip to content

Instantly share code, notes, and snippets.

View 9214's full-sized avatar

Vladimir Vasilyev 9214

  • 03:24 (UTC +05:00)
View GitHub Profile
@9214
9214 / scrape.red
Last active August 19, 2024 04:18
The world's smallest web scraper.
Red [
Title: "A Parse-based port of Michael Gilliland's web scraper"
Author: @9214
Date: 16-Oct-2020
Link: https://youtu.be/HDMa4gcgEgI
]
page: read-thru/binary to url! system/script/args
link: [copy match [ahead https:// url!]]
rule: [collect any [link keep (to url! match) | skip]]
@9214
9214 / bing.red
Last active August 19, 2024 04:18
Daily Bing photo fetcher.
Red [
Title: "Daily Bing photo fetcher"
Author: @9214
Date: 06-Aug-2021
]
bing: http://www.bing.com/
data: load rejoin [bing "HPImageArchive.aspx?format=js&idx=0&n=1"]
? (load rejoin [bing data/images/1/url])
@9214
9214 / encap.red
Created July 17, 2020 22:12
Old ad-hoc encapper for Red scripts.
Red [
Title: "ad-hoc build script (encapper?)"
Author: 9214
Purpose: "to bypass current compiler limitations (until dyn-stack is implemented)"
Rationale: {
As of 0.6.2, alpha Red compiler sometimes can't handle too dynamic code,
which leads to all kinds of cryptic errors either DURING or AFTER compilation.
General solution to this problem is:
* copy-paste all of your scripts into one block;
* remove all #include directives (to avoid `cannot open: <file>` errors);
@9214
9214 / puppy.red
Last active March 30, 2024 21:23
Puny GUI Puppy Finder in Red.
Red [
Title: "Puny GUI Puppy Finder, Red version"
Author: @9214
Date: 26-Apr-2020
Link: https://ahungry.com/blog/2020-04-24-Puny-GUI-Puppy-Finder.html
]
view [
title "Puppy Finder"
below center
Red [
Title: "Example of definitional scoping"
Date: 20-Mar-2017
Author: https://github.com/9214
File: %(s)puny-mortals.red
]
meditate: function ['on thing] [
print "ॐ"
@9214
9214 / math.red
Last active June 21, 2019 15:15
Extended MATH dialect.
Red [
Title: "Extended MATH dialect"
Author: 9214
Date: 12-Nov-18
]
math: function [
"Evaluate expression using PEMDAS precedence rules"
body [any-list!]
/local match
@9214
9214 / guraaku.red
Last active January 28, 2018 06:47
👽
Red [
Title: "crudely hacked together example DSL"
Link: https://stackoverflow.com/questions/48454538/how-to-parse-and-translate-dsl-using-red-or-rebol
Author: 9214
]
;;; example input
DSL: [
RULE TooYoung
IF [Person.Age < 15]