Skip to content

Instantly share code, notes, and snippets.

View jonasfrey's full-sized avatar
💭
🦅 burrr

Jonas jonasfrey

💭
🦅 burrr
  • Switzerland
View GitHub Profile
@jonasfrey
jonasfrey / geogebra_3d_input_slider_fix.js
Created March 15, 2024 16:06
geogebra input slider fix
// o , how annoying it was to constantly stay over the slider with the mouse while moving it
let f_a_n_trn__relative_to_o_html = function(
a_n__trn_mouse,
o_el
){
const o_brect = o_el.getBoundingClientRect();
return [
a_n__trn_mouse[0] - o_brect.left,
a_n__trn_mouse[1] - o_brect.top
@jonasfrey
jonasfrey / maximale_teilsumme.js
Last active February 27, 2024 16:02
maximale_teilsumme.js
let a_n = [
1, -2, -3, -10, 10, -10,-3, -2, -3, 322, -322,-4, -4, 1234
];
let n_sum_max = 0;
let n_idx_start_sum_max = 0;
let n_idx_end_sum_max = 0;
let n_idx_start = 0;
let n_idx_end = a_n.length;
@jonasfrey
jonasfrey / voyager__learn_text
Created February 16, 2024 09:19
text for learning the zsa voyager default staggered keyboard layout
Zack, the quick fox with 5 zealous cubs, jumps over 12 lazy dogs at 3:45 pm. Exciting visuals coax 7 zebras from vast, cozy dens by 6 exotic trees. 4 jazzy clubs buzz with 89 vivacious xylophones. Zac fixes the complex quiz vexingly for 2 hours. 13 cozy foxes doze in the buzzing, hazy glen of 9 acres. Vexing jinx mocks wiz quiz 78 times. Climb 5 jazzy rocks, vexing the lazy quokka with 0 effort. Exceedingly zippy crows vex 3 dwarfish gnomes. Jack quizzes the vexed cymbal on 10 xylophone jazz pieces. Buzzing bees vex the lazy coxswain 24/7. Juxtapose the 6 exotic crows and 11 zany foxes.
Zack, the quick fox, jumps over each lazy dog. Exciting visuals coax zebras from vast, cozy dens. Exotic jazz clubs buzz with vivacious xylophones. Zac fixes the complex quiz vexingly. Cozy foxes doze in the buzzing, hazy glen. Vexing jinx mocks wiz quiz. Climb jazzy rocks, vexing the lazy quokka. Exceedingly zippy crows vex dwarfish gnomes. Jack quizzes the vexed cymbal on xylophone jazz. Buzzing bees vex the lazy coxswain
@jonasfrey
jonasfrey / git_status_in_subdirectories_using_deno.js
Created October 27, 2023 15:26
git_status_in_subdirectories_using_deno
import {
f_o_command
} from "https://deno.land/x/o_command@0.9/mod.js"
let s_path = Deno.cwd();
for await(const o_entry of Deno.readDir(s_path)){
if(o_entry.isDirectory){
let s_path_folder = s_path + '/' + o_entry.name;
Deno.chdir(s_path_folder);
try {
@jonasfrey
jonasfrey / recursive_load_webserver_directories.js
Created October 26, 2023 12:49
recursive load webserver serving direcories
let f_a_o_from_o_doc = function(o_doc){
let a_o = Array.from(o_doc.querySelectorAll('a')).filter(v=>v.innerText.includes('/'))
return a_o
}
let f_recursive_show_direcotries = async function(
o_doc,
n_it_max_recursion = 1,
n_it_recursion = 0,
s_url=window.location.href
@jonasfrey
jonasfrey / shared_js_object_between_browser_tabs.js
Created July 6, 2023 22:19
share javascript object between browser tabs (with localStorage, Proxy and BroadCast)
let o_bc_o_localstorage = false;
if("BroadcastChannel" in window){
o_bc_o_localstorage = new BroadcastChannel('o_localstorage');
}
let f_o_localstorage_from_json_parse = function(){
let o_localstorage = {}
let s_o_localstorage = localStorage.getItem('o_localstorage');
if(s_o_localstorage){
o_localstorage = JSON.parse(s_o_localstorage)
}
@jonasfrey
jonasfrey / yt_scroll_to_bottom.js
Created March 8, 2023 17:03
youtube scroll to bottom of page
// i often want to see how a channel has started, so i want to have a look at the oldest videos of a channel,
// yt removed the sort by date function so here is a script when pasted it will automatically scroll to the bottom of the page
// ctrl+shift+i > console > paste code
window.setInterval(function(){
document.documentElement.scrollTo(0, document.documentElement.scrollHeight);
},10)
@jonasfrey
jonasfrey / yt_shorts_slider.js
Last active March 7, 2023 21:17
a time slider for youtube short videos
// import {f_o_html_from_o_js} from "https://deno.land/x/f_o_html_from_o_js@0.6/mod.js";
// use this chrome extension to inject the script on youtube pages including /shorts/ in the url
// https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld
var o_s_prop_name_s_attribute_name = {
"s_inner_text": "innerText",
}
let f_b_is_js_object = function(value){
return typeof value === 'object' && value !== null;
}
var f_o_html_from_o_js = function(
@jonasfrey
jonasfrey / monaco_vscode_editor_for_shadertoy.js
Last active April 2, 2023 20:26
monaco /vscode editor for shadertoy.com
var f_display_editor = null;
class O_error{
constructor(
n_idx_line,
s_text
){
this.n_idx_line = n_idx_line
this.s_text = s_text
}