Skip to content

Instantly share code, notes, and snippets.

@thomasjslone
thomasjslone / definitions.rb
Created February 12, 2025 21:17
most recent version of rubin system definitions as of feb 2025
ALPHA= ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
ALPHANUM = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"]
CHARS = [] ; c = 0 ; 256.times{ CHARS << c.chr.to_s ; c += 1 }
BINARY = [] ; c = 0 ; 256.times { b = c.to_s(2) ; until b.to_s.length == 8 ; b = "0" + b.to_s ; end ; BINARY << b ; c += 1 }
HEX = [] ; c = 0 ; 256.times { h = c.to_s(16) ; if h.length == 1 ; h = "0" + h.to_s ; end ; HEX << h ; c += 1 }
DAYS = ["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]
MONTHS = ["january","february","march","april","may","june","july","august","september","october","november","december"]
SEASONS = ["spring","summer","autum","winter"]
KEYWORDS = ["alias", "and", "begin", "break", "case", "class", "def", "defined?", "do", "else", "elsif", "end", "ensure",
"false", "for", "if", "in", "module", "next", "nil", "not", "or", "redo
@thomasjslone
thomasjslone / dirimage.rb
Created February 12, 2025 21:16
final version of dir image, redundant data handeling fixed
def image *args ## target, destination, strict
if args.length == 0 ; raise "Invalid arguemnts. Requires a target directory." ; end
if File.directory?(args[0].to_s) == false ; raise "Invalid target directory." ; else ; target = args[0].to_s ; end
if args.length > 1 ; if args[1].to_s == "" ; destination = Dir.getwd ; elsif File.directory?(args[1].to_s) ; destination = args[1].to_s ; else ; raise "Invalid arguemnts. No such destination directory." ; end ; end
strict = true ; if args.length > 2 and args[2] == false ; strict = false ; end
dirs = [] ; files = [] ; remaining = [target] ; cur = nil
loop do
if remaining.length == 0 ; break ; end
cur = remaining[0] ; remaining.delete_at(0)
begin ; cont = Dir.entries(cur) ; cont.delete(".") ; cont.delete("..") ; rescue ; if strict == true ; raise "Failed to map target directory." ; end ; next ; end
@thomasjslone
thomasjslone / dirimage.rb
Created February 12, 2025 18:28
dir image backup before final edits
def image *args ## target, destination
if args.length == 0 ; raise "Invalid arguemnts. Requires a target directory." ; end
if File.directory?(args[0].to_s) == false ; raise "Invalid target directory." ; end
if args.length > 1 ; if args[1].to_s != "" and File.directory?(args[1]) == false ; raise "Invalid destination directory." ; end ; end
target = args[0].to_s ; destination = args[1].to_s
dirs = [] ; files = [] ; remaining = [target] ; cur = nil
begin
loop do
if remaining.length == 0 ; break ; end
cur = remaining[0] ; remaining.delete_at(0)
@thomasjslone
thomasjslone / definitions.rb
Created February 9, 2025 22:50
definitions is upto date, no old ass code, no pointless methods, dir image finnaly a thing that makes sense, class / object / self methods less redundant
ALPHA= ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
ALPHANUM = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"]
CHARS = [] ; c = 0 ; 256.times{ CHARS << c.chr.to_s ; c += 1 }
BINARY = [] ; c = 0 ; 256.times { b = c.to_s(2) ; until b.to_s.length == 8 ; b = "0" + b.to_s ; end ; BINARY << b ; c += 1 }
HEX = [] ; c = 0 ; 256.times { h = c.to_s(16) ; if h.length == 1 ; h = "0" + h.to_s ; end ; HEX << h ; c += 1 }
DAYS = ["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]
MONTHS = ["january","february","march","april","may","june","july","august","september","october","november","december"]
SEASONS = ["spring","summer","autum","winter"]
KEYWORDS = ["alias", "and", "begin", "break", "case", "class", "def", "defined?", "do", "else", "elsif", "end", "ensure",
"false", "for", "if", "in", "module", "next", "nil", "not", "or", "redo
@thomasjslone
thomasjslone / gist:bc3c8bb95865cf664a5e2e6c1475f742
Created February 9, 2025 19:39
test app for creating dir images and encoding files, do not use this is garbagge just a proof of concept, this will be used for the additional resources feature of rubin install builders
class Test
def initialize
end
def encode(target)
if File.file?(target) == false ; raise "No such file." ; end
begin ; f = File.open(target,"rb") ; dat = f.read ; f.close
@thomasjslone
thomasjslone / rubin_installer-v1.0.29.rb
Created February 8, 2025 18:05
system apps are now a thing, added code to parse ADDITIONAL RESOURCES, when adding regular apps and files to an installation they will be extracted on first boot since they are not part of the system, INSTALL BUILDERS DO NOT SUPPORT THIS YET, next version will
PACKAGE = "04711411709810511004711512111511610110904711411709810511004611409806304711411709810511004711512111511610110904710009710110911111010004611409806304711411709810511004711512111511610110904710010110210511010511610511111011504611409806304711411709810511004710809711711009910404611409806304711411709810511004710011109904611612011606304711411709810511004710809711711009910403210511409804609910910006304711411709810511004710809711711009910403211411709810511004609910910006304711411709810511004710809711711009910403211411709810511003211410109911111810111412104609910910006304711411709810511004710809711711009910403211411709810511003210010109811710304609910910006304711411709810511004709910409711010310110811110304611612011606304711411709810511004710909711011709710804611612011606304711411709810511004711410109710003210910104611612011606304711411709810511004710009711609704711509911410511211611504711512111511610110910811110310911111010511611111404611409806304711411709810511004710009711609704711509911410511211611504710811
@thomasjslone
thomasjslone / rubin_installer-v1.0.28.rb
Created February 4, 2025 18:34
made adjustments to run and runs
PACKAGE = "04711411709810511004711512111511610110904711411709810511004611409806304711411709810511004711512111511610110904710009710110911111010004611409806304711411709810511004711512111511610110904710010110210511010511610511111011504611409806304711411709810511004710809711711009910404611409806304711411709810511004710011109904611612011606304711411709810511004710809711711009910403210511409804609910910006304711411709810511004710809711711009910403211411709810511004609910910006304711411709810511004710809711711009910403211411709810511003211410109911111810111412104609910910006304711411709810511004710809711711009910403211411709810511003210010109811710304609910910006304711411709810511004709910409711010310110811110304611612011606304711411709810511004710909711011709710804611612011606304711411709810511004711410109710003210910104611612011606304711411709810511004710009711609704711509911410511211611504711512111511610110910811110310911111010511611111404611409806304711411709810511004710009711609704711509911410511211611504710811
@thomasjslone
thomasjslone / rubin_installer-v1.0.27.rb
Last active January 21, 2025 20:43
Rubin 1.0.27 - Ruby bot system.
PACKAGE = "04711411709810511004711512111511610110904711411709810511004611409806304711411709810511004711512111511610110904710009710110911111010004611409806304711411709810511004711512111511610110904710010110210511010511610511111011504611409806304711411709810511004710809711711009910404611409806304711411709810511004710011109904611612011606304711411709810511004710809711711009910403210511409804609910910006304711411709810511004710809711711009910403211411709810511004609910910006304711411709810511004710809711711009910403211411709810511003211410109911111810111412104609910910006304711411709810511004710809711711009910403211411709810511003210010109811710304609910910006304711411709810511004709910409711010310110811110304611612011606304711411709810511004710909711011709710804611612011606304711411709810511004711410109710003210910104611612011606304711411709810511004710009711609704711509911410511211611504711512111511610110910811110310911111010511611111404611409806304711411709810511004710009711609704711509911410511211611504710811
@thomasjslone
thomasjslone / rubin_installer-v1.0.26.1.rb
Created January 10, 2025 18:05
fixed $args and recovery script launch, version has no incomplete features
## installer version 1.5
## Run this script to install Rubin System.
## Rubin System is a ruby app runtime environment. Built for Mingw Ruby and Windows.
## !! WARNING !! If you did not download this script from @thomasjslone's github, DO NOT RUN IT!
##
##init
$version='1.0.26' ; launch_directory=Dir.getwd; maindatasep = "#1#::#"+"1#::#4#"+"#9#::#1#::#2#" ; filenamesep = "#1#::#"+"3#::#1#"+"#4#::#1#::#8#" ; filesep = "#1#::#"+"1#::#0#"+"#3#::#7#::#5#" ; index_sep = "#1#::#"+"4#::#4#"+"#5#::#1#::#9#"
##checks
if defined?(SYSTEM) == "constant"
@thomasjslone
thomasjslone / rubin_installer-v1.0.25.rb
Created January 8, 2025 18:26
interpreter arguments implemented, not fully bug tested
## installer version 1.5
## Run this script to install Rubin System.
## Rubin System is a ruby app runtime environment. Built for Mingw Ruby and Windows.
## !! WARNING !! If you did not download this script from @thomasjslone's github, DO NOT RUN IT!
##
##init
$version='1.0.25' ; launch_directory=Dir.getwd; maindatasep = "#1#::#"+"1#::#4#"+"#9#::#1#::#2#" ; filenamesep = "#1#::#"+"3#::#1#"+"#4#::#1#::#8#" ; filesep = "#1#::#"+"1#::#0#"+"#3#::#7#::#5#" ; index_sep = "#1#::#"+"4#::#4#"+"#5#::#1#::#9#"
##checks
if defined?(SYSTEM) == "constant"