Skip to content

Instantly share code, notes, and snippets.

View rgchris's full-sized avatar

Christopher Ross-Gill rgchris

View GitHub Profile
@rgchris
rgchris / make-crc.reb
Created July 30, 2015 14:09
Calculate a CRC
Rebol [
Title: "Make CRC"
Date: 25-May-2015
Author: "Christopher Ross-Gill"
]
shift32: func [value [integer!] bits [integer!] /logical][
apply :shift [to integer! #{00000000FFFFFFFF} and to binary! value bits logical]
]
@rgchris
rgchris / test-power-mezz.reb
Last active August 29, 2015 14:27
Power Mezz failure on Ren/C
#!/usr/local/bin/ren-c
Rebol [
Title: "Power Mezz Test"
Date: 7-Jul-2015
Author: "Christopher Ross-Gill"
]
extend lib 'envelop envelop: func [value][compose [(value)]]
@rgchris
rgchris / comments-alt.c
Last active October 1, 2015 15:31
Spacing proposal for Rebol C source
///
/// quit: native
///
/// {Stop evaluating and return control to command shell or calling script.}
///
/// /with {Yield a result (mapped to an integer if given to shell)}
/// value [any-type!] "See: http://en.wikipedia.org/wiki/Exit_status"
/// /return "(deprecated synonym for /WITH)"
/// return-value
@rgchris
rgchris / sqlite-version.reb
Last active January 11, 2016 03:19
Obtain SQLite version with Rebol 3
#!/usr/local/bin/ren-c
Rebol [
Title: "SQLite Init"
Date: 10-Jan-2016
Author: "Christopher Ross-Gill"
Comment: [
"Ren/C branch build with LibFFI"
http://stackoverflow.com/a/34710721/292969
]
@rgchris
rgchris / shttpd.reb
Last active August 3, 2016 18:21
Rebol (Ren/C) HTTPD Server Scheme
#!/usr/local/bin/ren-c
Rebol [
Title: "A tiny static HTTP server"
Author: ["abolka" "Giulio Lunati"]
Date: [2009-11-04 2016-07-25]
; name: shttpd
; type: module
; exports: [shttpd]
]
@rgchris
rgchris / httpd.reb
Last active March 27, 2019 17:57
An HTTPD Scheme for Rebol 3 [Experimental]
Rebol [
Title: "HTTPD Scheme"
Date: 10-Jun-2013
Author: [
"Christopher Ross-Gill" 4-Jan-2017 "Adaptation to Scheme"
"Andreas Bolka" 4-Nov-2009 "A Tiny HTTP Server"
]
File: %httpd.reb
Version: 0.2.0
Rights: http://opensource.org/licenses/Apache-2.0
@rgchris
rgchris / ping.reb
Last active January 5, 2017 22:05
Port example: Send block to Server, Responds with reversed block.
#!/usr/local/bin/ren-c
Rebol [
Title: "Ping Scheme"
Date: 5-Jan-2017
Author: "Christopher Ross-Gill"
Home: https://github.com/revault/rebol-wiki/wiki/Port-Examples#tcp-ping-pong-messages
]
sys/make-scheme [
@rgchris
rgchris / int-to-bin.reb
Created January 25, 2017 04:59
Convert an Integer to Binary
Rebol [
Title: "Integer to Binary"
Date: 24-Jan-2017
]
method-1: func [
int [integer!]
][
debase/base to-hex int 16
]
#!/usr/local/bin/rebol -cs
Rebol [
Title: "HTTPD Scheme"
Date: 10-Jun-2013
Author: [
"Christopher Ross-Gill" 4-Jan-2017 "Adaptation to Scheme"
"Andreas Bolka" 4-Nov-2009 "A Tiny HTTP Server"
]
File: %httpd.reb
@rgchris
rgchris / light-control.reb
Last active February 1, 2017 04:39
Early Pass at HTTP Driven API to Send Commands to a UDP Server
#!/usr/local/bin/ren-c
Rebol [
Title: "Turn Lights On and Off"
Date: 31-Jan-2017
Author: "Christopher Ross-Gill"
File: %light-control.reb
Version: 0.1.0
Rights: http://opensource.org/licenses/Apache-2.0
]