Skip to content

Instantly share code, notes, and snippets.

View DreamOfTranscendence's full-sized avatar

Dream of Transcendence DreamOfTranscendence

View GitHub Profile
@DreamOfTranscendence
DreamOfTranscendence / sentance_compare.js
Created October 14, 2025 03:09
generic Sentance compare ( a cool hardcoded pseudo-ai language thing maybe )
self.compareWordSamePer100 = function compareWordSamePer100(s, s2)
{ //at least ##% of words must be the same for it to be considered the same
var re=/\s\s/g, haz={}, wut=[], i=0, L=s.length-3, cs;
s=s.toLowerCase().replace(re," ").replace(re," ");
s2=s2.toLowerCase().replace(re," ").replace(re," ");
while(i!=L){
cs="_"+s.substr(i,4);
if( ! (cs in haz) ){ haz[cs] = 1; wut.push(cs); }
else haz[cs] |= 1;
i++;
@DreamOfTranscendence
DreamOfTranscendence / cpp_syntax_hi_1.js
Last active September 19, 2025 02:52
c++ Syntax highlighter in JavaScript that outputs HTML formated highlighting from c++ code files input as a string
//Importiant: original code author:
//grabbed from: https://github.com/AdrS/CppToHTML
//GNU liscense or something IDK
//USAGE: Select and upload file from the file input element if you can find it,
//run this file on example.com or a blank webpage
// run: var htmlString=cpp_syntax_hi.htmlPrettyPrint(cpp_syntax_hi.files_e[0].textC), od2=document.createElement("div"); od2.innerHTML=htmlString; document.body.appendChild(od2);
//I might need this to make: https://gist.github.com/DreamOfTranscendence/0dbb2267f4ebd19441869fe793f46cab
@DreamOfTranscendence
DreamOfTranscendence / cpp_to_js_not_auto_porter.js
Last active September 19, 2025 05:18
Trying to convert some C++ code to javascript, automating some repetative text replacement
//https://gist.github.com/DreamOfTranscendence/1660dd5d50857ea3686e321d0f6a89fe
var js_req2=function js_require2_xhr(url){
var xhr=new XMLHttpRequest();
xhr.open("GET",url);
xhr.responseType="text";
xhr.onload=function(){
var j=document.createElement("script"); j.type="text/javascript"; j.setAttribute("data-from-url",url);
@DreamOfTranscendence
DreamOfTranscendence / git_resp_dig_search.js
Last active July 21, 2025 01:57
Search the entire text content of a raw file AND all the files in it's repository it (includes) links to
var parryTHIS=this.self||this; //the global js object should always be named "self", if you disagree with this you're no good at programming.
//(function gitRespDigSearchJs(){
var _M=(parryTHIS.gitRespDig={err:[],"c_syslib":[]}),
files_by_path=(_M.filesp={}),
xh=new XMLHttpRequest(),
xhBL=[], //xh backlog (I don't want infinite XHR object instances)
rpth="https://raw.githubusercontent.com/", rpth2="/refs/heads/master/",
getHubFile=(xh.onreadystatechange=(_M.gitFile=
@DreamOfTranscendence
DreamOfTranscendence / sndcld_crkr_l0l_node.js
Last active February 12, 2025 16:36
sndcld_crkr_l0l_node.js
//sndcld craker, nodejs. lol.
//this is a fun client-side-only lite 'hack'. It may not continue to work if the bot-detection system is well designed or if the developers see this hack and change the exact text patterns in their API
//designed to run in nodejs, nodejs has no audio player so I reccomend using ffplay that comes with the ffmpeg library/full-install
var https=require("https");
//exec_=require("child_process");
//zlib = require("zlib"); //use on resp buffer if needed to implement accept-encoding: gzip request header
if(typeof self=="undefined") let self=this; //must be global context this right here