Skip to content

Instantly share code, notes, and snippets.

View rebolek's full-sized avatar

Boleslav Březovský rebolek

  • 07:51 (UTC +02:00)
View GitHub Profile
Red []
note: {OAuth oauth_nonce="K7ny27JTpKVsTgdyLdDfmQQWVLERj2zAK5BslRsqyw", oauth_callback="http%3A%2F%2Fmyapp.com%3A3005%2Ftwitter%2Fprocess_callback", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1300228849", oauth_consumer_key="OqEqJeafRSF11jBMStrZz", oauth_signature="Pc%2BMLdv028fxCErFyi8KXFM%2BddU%3D", oauth_version="1.0"}
; do %json.red
user: #()
twitter: https://api.twitter.com/
verification-page: %oauth/authorize?oauth_token=
@rebolek
rebolek / draw-style.red
Last active April 12, 2017 10:45
Draw style example
Red[]
Arial: make font! [name: "Consolas" size: 20]
d0: [
pen 240.240.240
fill-pen 240.240.240
box 0x0 80x40
fill-pen
]
d1: compose [
(d0) red
Red [
Needs: 'View
]
; #include %support/call.red
print "clr - define object"
celer: object [
@rebolek
rebolek / incredidle.red
Created May 15, 2017 17:12
Simple tool to show how faces work
Red []
inc-value: func [
face
color-id
dest-face
/local value rate
] [
unless face/extra [face/font/color: 255.255.255]
overflow?: false
@rebolek
rebolek / nsource.red
Last active June 19, 2019 20:11
Provides source of Red native functions
Red [
Title: "Nsource - native source"
Purpose: "Print source for native functions"
Author: "Boleslav Březovský"
Date: "8-6-2017"
]
indent: func [
"(Un)indent text by tab"
string [string!] "Text to (un)indent"
@rebolek
rebolek / join.red
Last active February 7, 2018 10:11
Red[]
join: func [
"Reduce values in a block and joins them into a string"
block [block!]
/with "Add delimiter between values"
delimiter
/trim "Remove NONE values"
] [
if empty? block [return ""]
Red [
Title: "Replace with /CASE support"
]
replace: func [
"Returns the series where a value is found, or NONE. "
series [series!]
pattern
value
/all
@rebolek
rebolek / base32.red
Created August 16, 2017 20:18
Base 32 encoder and decoder
Red [
file: %base32.red
date: 17-Sep-2015
author: "Graham Chiu"
red-version: "Boleslav Březovský"
version: 0.0.3
notes: {
encodes string to base32 or base32hex
padding to 5 characters is not required in this method
>> to-base32/decode/hex to-base32/hex "yessir"
Red[]
reduce+: func [
"Reduce with unset!, error! -> none! conversion"
block
/local value new-block
][
new-block: block
collect [
until [
console.log("%main.js");
rooms = null;
users = null;
// load room names
load_rooms = function (){
d3.csv("data/room-list.csv", function(error, data) {
if (error) throw error;
console.log("loading rooms");