Skip to content

Instantly share code, notes, and snippets.

@gchiu
gchiu / testtls.reb
Last active May 19, 2017 05:28
smtp test
rebol []
server: tls://smtp.gmail.com:465
server: tls://smtp.sparkpostmail.com:587
smtp: open server
net-trace on
smtp/awake: function [event /local port] [
net-log ajoin ["=== Client event:" event/type]
@gchiu
gchiu / decodexml.reb
Created May 16, 2017 04:57
altxml error
rebol []
import <xml>
content: {<div class='partial'>google$ probe to string! read http://www.rebol.com <br> ^{&lt;!doctype html&gt; <br> &lt;html&gt;&lt;head&gt; <br> &lt;meta name=&quot;generator&quot; content=&quot;REBOL WIP Wiki&quot;/&gt; <br> &lt;meta name=&quot;date&quot; content=&quot;3-Aug-2016/5:30:21&quot;/&gt; <br> &lt;meta name=&quot;rebol-version&quot; content=&quot;2.100.97.4.2&quot;/&gt; <br> &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=UTF-8&quot;/&gt; <br> &lt;meta http-equiv=&quot;Pragma&quot; content=&quot;no-cache&quot; /&gt; <br> &lt;meta http-equiv=&quot;Expires&quot; content=&quot;-1&quot; /&gt; <br> &lt;meta http-equiv=&quot;Cache-Control&quot; content=&quot;no-cache&quot; /&gt; <br> &lt;meta name=&quot;Description&quot; content=&quot;REBOL: a lightweight computer language with advanced semantics. Site includes products, downloads, documentation, and<span>&hellip;</span></div>}
decode-xml content
comment {
>> do %decodexml.reb
@gchiu
gchiu / libraries.reb
Last active March 31, 2017 22:24
look up table of libraries for ren-c
[
<json> [https://raw.githubusercontent.com/rgchris/Scripts/master/ren-c/altjson.reb]
<xml> [http://giuliolunati.altervista.org/r3/altxml.reb]
<amazon-s3> [http://reb4.me/r3/s3.reb]
<httpd> [https://raw.githubusercontent.com/rgchris/Scripts/master/ren-c/httpd.reb]
<twitter> [https://raw.githubusercontent.com/gchiu/rebolbot/master/twitter.r3]
<trello> [http://codeconscious.com/rebol-scripts/trello.r]
<upgrade> [https://raw.githubusercontent.com/gchiu/rebol-misc/master/upgrade.reb]
<rebmu> [https://raw.githubusercontent.com/hostilefork/rebmu/master/rebmu.reb]
@gchiu
gchiu / make.txt
Created March 26, 2017 02:19
out put from make -f makefile.boot
./r3-make -qs ../src/tools/make-make.r OS_ID=detect GIT_COMMIT=e79023423424adfasfs
Option set for building: 0.4.40 linux-x64
Created: ../../make/makefile
make prep
make[1]: Entering directory `/home/ren-c/make'
./r3-make -qs ../src/tools/make-natives.r
------ Generate tmp-natives.r
228 natives
------ Generate tmp-actions.r
@gchiu
gchiu / hmac-sha256-test.reb
Created March 12, 2017 00:08
test for run-recover.r
[#{B0344C61D8DB38535CA8AFCEAF0BF12B881DC200C9833DA726E9376C2E32CFF7} = hmac-sha256 #{0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B} #{4869205468657265}]
[#{5BDCC146BF60754E6A042426089575C75A003F089D2739839DEC58B964EC3843} = hmac-sha256 #{4A656665} #{7768617420646F2079612077616E7420666F72206E6F7468696E673F}]
[#{773EA91E36800E46854DB8EBD09181A72959098B3EF8C122D9635514CED565FE} = hmac-sha256 #{AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA} #{DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD}]
[#{82558A389A443C0EA4CC819899F2083A85F0FAA3E578F8077A2E3FF46729665B} = hmac-sha256 #{0102030405060708090A0B0C0D0E0F10111213141516171819} #{CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD}]
[#{60E431591EE0B67F0D8A26AACBF5B77F8E0BC6213728C5140546040F0EE37F54} = hmac-sha256 #{AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
rebol []
hmac-sha256: func [k m][
key: copy k
message: copy m
blocksize: 256
if (length key) > blocksize [
key: sha256 key
]
if (length key) < blocksize [
Rebol [
file: %write-udp.reb
]
url: udp://239.255.255.250:1900
commands1: copy [ #{460055} .1 #{4E0E55}]
commands2: copy [ #{460055} #{4E0E55}]
write-udp: func [url [url!] commands
/local port command
@gchiu
gchiu / test.reb
Created February 25, 2017 20:10
series error
rebol []
; do %shttpd.reb
; do https://raw.githubusercontent.com/rgchris/Scripts/master/httpd.reb
do https://gist.githubusercontent.com/rgchris/96a02d1a226d0ab2e605914fce6bcf80/raw/f96b8a1b7bb9b9f972f86e45f8d74a404808b747/httpd-renc.reb
server: open [
scheme: 'httpd 8001 [
probe request/action
switch request/action [
@gchiu
gchiu / ssdp-server.reb
Last active February 24, 2017 00:15
testing ssdp listen
Rebol [
file: %ssdp-server.reb
]
serve-udp: open udp://:1900
serve-udp/awake: func [evt][
; print ["multicast event:" evt/type " on " evt/port/spec/port-id " at " now/precise]
; probe query evt/port
print ["Event received on UDP ===>" evt/type]
@gchiu
gchiu / a1.reb
Last active February 19, 2017 20:02
UDP and HTTP server in Ren-c
Rebol [
file: %a1.reb
notes: {ssdp with http server in ren-c
httpd.reb is here https://gist.github.com/rgchris/73510e7d643eb0a6b9fa69b849cd9880
}
]
serve-udp: open udp://:1900