Skip to content

Instantly share code, notes, and snippets.

View dockimbel's full-sized avatar

Nenad Rakocevic dockimbel

View GitHub Profile
@hiiamboris
hiiamboris / lagometer.red
Last active January 28, 2021 16:51
lagometer
Red [needs: view]
img: draw 4000x2000 [scale 2 2 fill-pen yello circle 1000x500 1000 500]
lag: object [max: avg: 0.0]
offset: 0x0
plot: []
system/view/auto-sync?: off
view/no-wait [
below
@Oldes
Oldes / html-entities.red
Last active May 13, 2020 10:05
HTML entities
Red [
Title: "HTML entities"
Purpose: "To decode HTML entities in a text"
Author: "Oldes"
Date: 12-May-2020
Version: 1.0.2
License: MIT
Usage: [
"Test: ♠ & ¢ <a> and Δδ ¾" =
decode-html-entities {Test: &spades; & &#162; &lt;a&gt;&#32;and &Delta;&delta; &frac34;}
@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
@toomasv
toomasv / parse-study.red
Created November 23, 2019 14:37
Study matching of `any-string!`, `any-word!` and `any-path!` values in `parse`
Red [
Description: "Study of parsing `any-string!`, `any-word!` and `any-path!` values"
Date: 23-Nov-2019
]
string-parse: function [s /case /quote /upper /block][
l: append/dup copy "" #" " 15
s2: either upper [uppercase copy s][s]
print append copy l "string url tag email file"
types: [to-string to-url to-tag to-email to-file]
@toomasv
toomasv / rays.red
Last active August 2, 2019 19:22
Ray-casting exercise
Red [
Description: {Ray casting exercise}
Needs: View
Date: 25-July-2019
Inspiration: https://github.com/krisajenkins/elm-rays
Tutorial: https://ncase.me/sight-and-light/
Redporter: "Toomas Vooglaid"
Licence: "Public domain"
]
; To change into plain light instead of radial
@nedzadarek
nedzadarek / linked_list.red
Created June 21, 2019 13:03
Linked list using only `path!`
Red [
author: {Nędza Darek}
license: {
- use/modify everywhere
- point to this gist/github
- no warranties
}
version: 0.0.1
]
p1: to-path bind [next a] context [next: 11]
@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
@toomasv
toomasv / check.red
Last active March 16, 2019 22:25
Checking for matching/closing of nested thing and strings
Red []
ctx: context [
char: charset {([{}])"} ;"
opens: charset "[("
closes: charset "])"
line: 1
stack: make block! 1000
mark: comm: none
instr: false
inmulti: 0
@meijeru
meijeru / check-structure.red
Last active February 1, 2019 16:22
Check if brackets/parens are matching in a Red source and give errors with indication of line number
Red [
Title: "Red program structure checker"
Purpose: {Check if brackets/parens are matching in a Red file
and give errors with indication of line number}
Author: "Rudolf W. MEIJER"
File: %check-structure.red
History: [
[0.0 04-Jan-2019 {Start of project}]
[0.5 05-Jan-2019 {First working version}]
[0.6 01-Feb-2019 {Added %" "}]
@yvern
yvern / fun.red
Last active September 30, 2018 06:20
Functional constructs experiments in Red
->: make op! :function ; arrow-style lambdas: [x]->[x + 1]
id: ["Identity function, one in, same out" x]->[x]
;--------------------------------------------------------------------------------------
cmp: ["Gets a block! of words! or blcoks! that represent a function! and composes it in the usual way"
fs [any-block!]]->[ [x]-> compose/deep/only [take reduce append (reduce fs) [x] ]
]