This file contains hidden or 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 "open-uri" | |
require "net/http" | |
require "openssl" | |
@page = "unloaded" | |
@html = "unloaded" | |
uri = URI.parse(ARGV[0] || 'https://en.wikipedia.org/wiki/Hydrogen') | |
http = Net::HTTP.new(uri.host, uri.port) | |
if uri.scheme == "https" # enable SSL/TLS | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_PEER |
This file contains hidden or 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
## Ossy Core - Version 1.4.0.0 | |
## OCT21-2017 - Thomas J. Slone | |
CORE_VERSION = "1.4.0.3" ; CORE_DATE = "2017.11.22.10.40.21" | |
CORE_AUTHOR = "Thomas J. Slone" ; CORE_MANUFACTURER = "Tomtech" | |
CORE_NAME = "Ossy" ; CORE_EDITION = " Another edition. " | |
CORE_INIT_TIME = Time.now ; CORE_BOOT_LOG = [] | |
MAIN = self | |
ADMIN = "admin" ; PASSWORD = "" |
This file contains hidden or 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
# webcrawler 1.0 created 2021.05.04 ## follow the term across every connected link blindly | |
require 'uri';require 'open-uri' | |
class Web_Crawler | |
def initialize | |
@case_sensitivity=false | |
end | |
def crawl(base_page,term) | |
@counter=0 ##number of loops executed\pages crawled | |
@search_term=term.to_s ## a string to search pages for |
This file contains hidden or 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
# webcrawler 1.1 created 2021.05.04 last updated 2021.05.05 j.thomas | |
# starts with a basepage and grabs links as it finds them in each page while noting instances of search term appearences in pages and links | |
require 'uri';require 'open-uri' | |
class Web_Crawler | |
def initialize | |
@case_sensitivity=false ## wether caps is ignored when looking for search term | |
@counter=0 ##number of loops executed\pages crawled | |
@invalid_counter=0 ## number of invalid pages checked | |
@already_searched=[] ## links to not crawl again | |
@search_term='' |
This file contains hidden or 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
## all 256 ascii characters | |
CHARS = [] ; c = 0 ; 256.times{ CHARS << c.chr.to_s ; c += 1 } | |
## every 8 bit binary number in order | |
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 } | |
## every hexicdeimal number in order upto 256 ordinals | |
HEX = [] ; c = 0 ; 256.times { h = c.to_s(16) ; if h.length == 1 ; h = "0" + h.to_s ; end ; HEX << h ; c += 1 } | |
## a list of all 8 bit byte codes for the ascii characters | |
BYTES = [] ; HEX.each do |h| ; BYTES << "\\x" + h ; end | |
def only_letters? s ;s.upcase.delete("ABCDEFGHIJKLMNOPQRSTUVWXYZ").empty?;end |
This file contains hidden or 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
# | |
# Python | |
# | |
def prime(num): | |
rv=True;c=1;l=num-1 | |
while c<l: | |
c=c+1 | |
if int(str(num/c).split('.')[-1])==0: | |
rv=False;c=num | |
return rv |
This file contains hidden or 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
## | |
## Python | |
## | |
def exp(n): | |
c=2 | |
e=2 | |
rv=False | |
while c<=n: | |
e=2 |
This file contains hidden or 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
## to_b methods dependant on ossy string class | |
class Dex | |
def initialize | |
## create data folder if it doesnt exist | |
@data_path=HOMEDIR+"/app/dex/data" | |
if File.exist?(@data_path)==false | |
Dir.mkdir(HOMEDIR+"/app/dex/data") | |
end | |
@bankfile=0 | |
if File.exist?(@data_path+"/"[email protected]_s+".db")==false |
This file contains hidden or 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
current_update 2021.11.6.7.2 | |
A bunch of ruby code i use to write | |
more complex ruby apps | |
more info and classes are being added all the time with the last major version change being september 2021 now at 7.2 | |
version rollover soon!!! (less than 2 weeks now, so much is about to be fixed with dir and file, im releasing an encoder too) | |
next: | |
shadow cert | |
gem manager |
This file contains hidden or 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
## rubin entry point is the rubin sys class file right now | |
## but could become this file in the future | |
##this file should never be anything more than a shortcut | |
## shortcuts to this file can have their own window config | |
load Dir.getwd.to_s+'/sys/rubin.rb' |