Skip to content

Instantly share code, notes, and snippets.


Maxim Velesyuk maximvl

View GitHub Profile
View gen_tcp2.erl
-export([listen/2, accept/1, accept/2,
connect/3, connect/4,
send/2, recv/1, recv/2, recv/3,
-export([run/0, run/2]).
%% Naive gen_tcp shim over the socket API
dockimbel /
Created Apr 3, 2018
Test script for Red/View Android backend
Red [
Title: "Red Android bridge demo"
Author: "Nenad Rakocevic"
Config: [type: 'dll libRed?: no libRedRT?: yes export-ABI: 'cdecl]
Tabs: 4
Needs: 'View
Rights: "Copyright (C) 2013-2017 Nenad Rakocevic. All rights reserved."
License: {
Distributed under the Boost Software License, Version 1.0.
toomasv /
Last active Mar 23, 2018
Digging deeper into curves
Red [
Author: "Toomas Vooglaid"
Date: 2018-03-19
lut: [[1][1 1][1 2 1][1 3 3 1][1 4 6 4 1][1 5 10 10 5 1][1 6 15 20 15 6 1]]
binomial: func [n k /local s nextRow i prev][
while [
n > s: length? lut
toomasv /
Last active Feb 21, 2019
Experiments with L-System
Red [
Author: "Toomas Vooglaid"
Date: 25-9-2017
Description: {Experiments with L-System}
Last-update: 26-9-2017
Uses: {}
context [
ctx: self
toomasv /
Last active Nov 28, 2017
To get info about any function
Red []
info: func ['fn /name /intro /args /refinements /locals /return /spec
/arg-num /arg-names /arg-types /ref-names /ref-types /ref-num /type /arity?
/local intr ars refs locs ret arg ref typ irefs
intr: copy "" ars: make map! copy [] refs: make map! copy [] locs: copy [] ret: copy [] irefs: copy [] typ: ref-arg: ref-arg-type: none
if path? fn [irefs: copy next to-block fn fn: first fn]
if lit-word? fn [fn: to-word fn]
unless find [op! native! function! action!] type?/word get fn [
cause-error 'user 'message ["Only function types accepted!"]
rebolek /
Created May 15, 2017
Simple tool to show how faces work
Red []
inc-value: func [
/local value rate
] [
unless face/extra [face/font/color: 255.255.255]
overflow?: false
greggirwin /
Created Mar 25, 2017
Small GUI experiment for showing datatype information.
Red []
form-all: func [blk][
forall blk [blk/1: form blk/1]
types-of: function [value [typeset!]][
; typesets don't support reflection
third load mold value
DideC /
Last active Jan 30, 2017
Heart animation for Red (only). New parameters added to the (reordered) control panel to play with the animation + credits. Nice time eater ;-)
Red [
title: "Heart animation"
author: "Didier Cadieu"
notes: {
Traduction in Red of Terebus Volodymyr javascript demo :
Needs: View
;*** Settings
Red [
Title: "Conway's Game of Life"
Needs: 'View
system/view/auto-sync?: no
grid: collect [repeat i 50 [keep/only collect [repeat j 50 [keep random true]]]]
scratchgrid: collect [repeat i 50 [keep/only collect [repeat j 50 [keep false]]]]
a: copy grid/1
b: copy grid/50
Red [
Title: ""
Author: ["Gregg Irwin" "Steeve"]
Purpose: {
Factor style fry combinators in Red
works somewhat like a reverse collect/keep