Skip to content

Instantly share code, notes, and snippets.

@toomasv
toomasv / l-system.red
Last active February 21, 2019 12:11
Experiments with L-System
Red [
Author: "Toomas Vooglaid"
Date: 25-9-2017
Description: {Experiments with L-System}
Last-update: 26-9-2017
Uses: {%models.red https://gist.github.com/toomasv/313e1d8583fb159428222651b76926cd}
Repo: https://github.com/toomasv/l-system
]
context [
ctx: self
@toomasv
toomasv / bezier.red
Last active March 23, 2018 13:52
Digging deeper into curves
Red [
Author: "Toomas Vooglaid"
Date: 2018-03-19
Inspiration: https://pomax.github.io/bezierinfo
]
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
@dockimbel
dockimbel / eval2.red
Created April 3, 2018 10:12
Test script for Red/View Android backend
Red [
Title: "Red Android bridge demo"
Author: "Nenad Rakocevic"
File: %eval2.red
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.
@mul14
mul14 / profile.md
Created October 26, 2018 00:35 — forked from ezekg/profile.md
iTerm key bindings

Open the iTerm preferences ⌘+, and navigate to the Profiles tab (the Keys tab can be used, but adding keybinding to your profile allows you to save your profile and sync it to multiple computers) and keys sub-tab and enter the following:

Delete all characters left of the cursor

⌘+←Delete Send Hex Codes:

  • 0x18 0x7f – Less compatible, doesn't work in node and won't work in zsh by default, see below to fix zsh (bash/irb/pry should be fine), performs desired functionality when it does work.
  • 0x15 – More compatible, but typical functionality is to delete the entire line rather than just the characters to the left of the cursor.

Delete all characters right of the cursor

⌘+fn+←Delete or ⌘+Delete→ Send Hex Codes:

  • 0x0b
-module(gen_tcp2).
-export([listen/2, accept/1, accept/2,
connect/3, connect/4,
send/2, recv/1, recv/2, recv/3,
close/1]).
-export([run/0, run/2]).
%% Naive gen_tcp shim over the socket API