This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##about this code | |
## in windows a mounted disks path is a drive letter C:/ E:/ F:/ ect. | |
## however in linux the path is the name of the disk, if a disk is named "rubin" the launch | |
## will fail because it expects the name rubin to only be in a path once | |
##this error will also occur if the install is nested in multiple directories named 'rubin' | |
## this code is outdated and may not be needed anymore | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## launch.rb ; file ver 1.0 for rubin 1.0.4 and up ; Rubin system default launcher. Thomas J Slone 2024 11 3 | |
##big news! this file is now a proper launcher, rubin can still be started by loading the system file in an interpreter from the home directory | |
## however this launcher will perform startup checks and configure the interpreter for various runtime modes (such as debug, windowless, server, low memory) | |
##this file is the entry point for rubin system, it can be ran a few ways, explorer.exe can have it clicked, cmd.exe can tell ruby.exe to run this file, or an already running | |
##interpreter can load this file, this file cannot be evaled by a client/console outside of the install directory | |
##prepare args to be passed if there are any | |
if ARGV.length > 0 ; $argv = ARGV ; $argv.insert(0,"-") ; $argv = $argv.join(" ") | |
else ; $argv = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@# dictionarydatabank.rb - version 1.0 tested on 2024.07.26 - thomas j slone | |
## a sort of database, designed for dictionary builders, store billions of words by dividing massive arrays into bank files of limited size. | |
## final todos | |
## | |
## enforce add string size limit | |
## add a config file for banks so when reloading bank and string sizes dont have to be given only when making a bank for the first time | |
## add methods for geting and setting size limits and possibly renaming bank though that literally requires moving the entire directory to rename it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def draw_spiral(size) | |
grid = Array.new(size * 2 + 1) { Array.new(size * 2 + 1, ' ') } | |
x, y = size, size | |
direction = 0 # 0: right, 1: down, 2: left, 3: up | |
step = 1 | |
(size * size).times do |i| | |
grid[y][x] = '*' | |
case direction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def splice(b,e) | |
ilist = [] | |
if b.is_a?(String) == false or e.is_a?(String) == false; raise "Arguements require String type." | |
elsif b.to_s=="" or e.to_s == ""; raise "Arguements cannot be nilstring." | |
end | |
s=self ## self inside the loop will not be the string | |
if s.length<=(b.to_s.length+e.to_s.length); raise "Base string is too small."; end | |
pos=0; stack = false; list=[] | |
if b.length > e.length ; buffer_length = b.length; else; buffer_length = e.length; end | |
buffer = []; buffer_length.times{ buffer << "" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####################################################### | |
# | |
# demo-ruboto-irb.rb (by Scott Moyer) | |
# | |
# This demo duplicates the functionality of | |
# Ruboto IRB (written in Java) with a ruboto | |
# script (written in Ruby). | |
# | |
####################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERSION='1.0.30' | |
## RubinSystem is a ruby app runtime environment. Multi-Instance, bot controller on Mingw Windows Ruby | |
## ## !! WARNING !! If you did not download this script from github or the official website, DO NOT RUN IT! | |
## Run this script to install Rubin System, either select the work directory or enter an install location. | |
## After installing run "launch.rb" and you will get the system shell by default. The shell runs input as | |
## ruby script on the RubinSystem context. Precede a command with * if you are entering windows scripts | |
## or host commands, also *context=MAIN changes shell context. The shell does not handle stack errors well | |
## so IRB is used to catch error messages that crash the shell. | |
## | |
## Upon first use, you will get a default system config, use SYSTEM.config? to see what config settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def splice(b, e) | |
if !b.is_a?(String) || !e.is_a?(String) ; raise "Arguments require String type." | |
elsif b.empty? || e.empty? ; raise "Arguments cannot be empty." | |
end | |
s_copy = self.dup | |
if s_copy.length <= (b.length + e.length); raise "Base string is too small."; end | |
pos = 0 ; stack = false ; list = [] | |
if b.length > e.length ; buffer_length = b.length | |
else ; buffer_length = e.length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def splice(b,e) | |
if b.is_a?(String) == false or e.is_a?(String) == false; raise "Arguements require String type." | |
elsif b.to_s=="" or e.to_s == ""; raise "Arguements cannot be nilstring." | |
end | |
s=self ## self inside the loop will not be the string | |
if s.length<=(b.to_s.length+e.to_s.length); raise "Base string is too small."; end | |
pos=0; stack = false; list=[] | |
if b.length > e.length ; buffer_length = b.length; else; buffer_length = e.length; end | |
buffer = []; buffer_length.times{ buffer << "" } | |
empty_buffer=[]; buffer_length.times{ empty_buffer << "" } ## again, in the loop we can only refer to vars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
class Password | |
def initialize(string, seed) | |
@seed = seed | |
cipher = OpenSSL::Cipher.new('AES-256-CBC') | |
cipher.encrypt | |
cipher.key = Digest::SHA256.digest(@seed) | |
@password = cipher.update(string) + cipher.final | |
end | |
NewerOlder