Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher Ross-Gill rgchris

View GitHub Profile
@rgchris
rgchris / pdf.r
Last active Jan 19, 2022
PDF Modeller/Constructor for Rebol 2
View pdf.r
Rebol [
Title: "PDF Experiment"
Author: "Christopher Ross-Gill"
Date: 18-Jan-2022
Home: https://gist.github.com/rgchris
File: %pdf.r
Version: 0.1.0
Rights: http://opensource.org/licenses/Apache-2.0
Purpose: {
Build a PDF object model for atomic construction of PDF documents
@rgchris
rgchris / unzip.r
Last active Jan 4, 2022
Unzip for Rebol 2
View unzip.r
Rebol [
Title: "Unzip for Rebol 2"
Date: 3-Jan-2022
Author: "Christopher Ross-Gill"
]
do %tiny-inflate.r
; obtain from
; https://gist.github.com/rgchris/d3fb5f6a6ea6d27ea3817c0e697ac25d
@rgchris
rgchris / minimal-odt.reb
Created Dec 31, 2021
Build a minimal ODT (ODF Text) in R3C
View minimal-odt.reb
#!/usr/local/bin/ren-r3c
Rebol [
Title: "Package a Minimal OpenText Document"
Date: 30-Dec-2021
Author: "Christopher Ross-Gill"
Rights: http://opensource.org/licenses/Apache-2.0
Home: https://gist.github.com/rgchris/e325347625b1688a1a1fe686610c68ba
]
@rgchris
rgchris / tiny-inflate.r
Last active Jan 4, 2022
Tiny Inflate for Rebol 2
View tiny-inflate.r
Rebol [
Title: "Tiny Inflate"
Date: 10-Dec-2021
Author: "Christopher Ross-Gill"
Version: 1.0.3
Type: 'module
Name: 'rgchris.inflate
Exports: [inflate]
History: [
10-Dec-2021 1.0.3 https://github.com/foliojs/tiny-inflate
@rgchris
rgchris / builder.js
Last active Nov 19, 2021
DOM Builder
View builder.js
const Bd = function (name, attrs, ...kids) {
const spaces = {
xhtml: 'http://www.w3.org/1999/xhtml',
svg: 'http://www.w3.org/2000/svg'
}
const fullname = name.split(':')
name = fullname.pop()
@rgchris
rgchris / istype.js
Last active Apr 2, 2021
A type-checking function in JavaScript
View istype.js
window.istype = function(value, explicit = false) {
let type = Object.prototype.toString.apply(value).match(
/\[object ([A-Za-z_0-9]+)\]/
)[1]
switch (type) {
case "Boolean":
case "String":
case "BigInt":
case "Undefined":
@rgchris
rgchris / state-machine.reb
Last active Oct 28, 2021
State Machine for Ren-C (R3C)
View state-machine.reb
Rebol [
Title: "State Machine Dialect"
Date: 3-Feb-2021
Author: "Gabriele Santilli"
File: %state-machine.reb
Type: module
Name: rgchris.state-machine
Version: 1.8.1
Exports: [state-machine]
@rgchris
rgchris / data-uri.reb
Last active Feb 13, 2021
Scheme for Encoding/Decoding Data URIs
View data-uri.reb
Rebol [
Title: "Data URI Scheme"
Date: 13-Feb-2021
Author: "Christopher Ross-Gill"
]
use [chars type] [
chars: complement charset "^-^/^M ,/;"
sys/make-scheme [
@rgchris
rgchris / textmate.reb
Last active Feb 8, 2021
TextMate Bundle Support File (R3C)
View textmate.reb
Rebol [
Title: "TextMate Support"
Author: "Christopher Ross-Gill"
Date: 8-Feb-2021
Type: module
Name: rgchris.textmate
Exports: [tm textmate neaten envelop form-error]
]
tm: make object! [
@rgchris
rgchris / clean-script.reb
Last active Feb 10, 2021
Clean Script for R3C
View clean-script.reb
Rebol [
Title: "Rebol Script Cleaner (Pretty Printer)"
Date: 10-Feb-2021
File: %clean-script.reb
Version: 1.2.3
Type: module
Name: rgchris.clean-script
Exports: [clean-script]
Author: "Christopher Ross-Gill"
Purpose: {