Discuss Scratch

ajskateboarder
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

WojtekGame wrote:

WojtekAdvanced wrote:

hi myself
hi, also sorry ST for using storage space on the forums :<
It's not a big deal you know
WojtekGame
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

{offtopic}

ajskateboarder wrote:

WojtekGame wrote:

WojtekAdvanced wrote:

hi myself
hi, also sorry ST for using storage space on the forums :<
It's not a big deal you know
IK!
{/offtopic}
WojtekGame
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

bump
WojtekGame
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

bump, i dunno
WojtekGame
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

bump (scream)
WojtekAdvanced
Scratcher
38 posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

BUMP, WHY.
WojtekGame
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

bump, yes that's a lot of topics getting out of nowhere , idk why tho, but i might do something better but this will be still on production!
MonkeyBean2
Scratcher
500+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

bigspeedfpv wrote:

why do scratchers have an aversion to using ui libraries
document.createElement('div') is the strangest one i've seen yet i think
document.createElement('div')
umm that isn't exactly a UI library…

Last edited by MonkeyBean2 (March 17, 2023 10:37:02)

MonkeyBean2
Scratcher
500+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

if (f.style === "emoji" && f.style === "emoji-hacker") {
...

This should never be true, as the following should always be true:
f.style === f.style && "emoji" !== "emoji-hacker" 

Last edited by MonkeyBean2 (March 17, 2023 10:39:58)

MonkeyBean2
Scratcher
500+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

You should make this work with npx
bigspeedfpv
Scratcher
500+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

MonkeyBean2 wrote:

bigspeedfpv wrote:

why do scratchers have an aversion to using ui libraries
document.createElement('div') is the strangest one i've seen yet i think
document.createElement('div')
umm that isn't exactly a UI library…
exactly…? “an aversion to using ui libraries”
WojtekGame
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

MonkeyBean2 wrote:

if (f.style === "emoji" && f.style === "emoji-hacker") {
...

This should never be true, as the following should always be true:
f.style === f.style && "emoji" !== "emoji-hacker" 
you know that i didn't update the code yet… -_-

MonkeyBean2 wrote:

You should make this work with npx
hmm…

import loadDir from "code-gui";
loadDir("C:/", {"style":"text"})
as in the “bin” property in package.json, but for now, nope!
ZZZDUD
New Scratcher
100+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

Is this thing running on a potato! It took 54.4 seconds for it to run inside the VM (Safety first ofc)
WojtekGame
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

ZZZDUD wrote:

Is this thing running on a potato! It took 54.4 seconds for it to run inside the VM (Safety first ofc)
note that i'm a regular Node.js user and not tested it in different systems.
WojtekGame
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

ZZZDUD wrote:

WojtekGame wrote:

ZZZDUD wrote:

Is this thing running on a potato! It took 54.4 seconds for it to run inside the VM (Safety first ofc)
note that i'm a regular Node.js user and not tested it in different systems.
Your code is so slow. Even this would be better
import os
def good_tree(start_path, padding='', branch=''):
    if not os.path.isdir(start_path):
        return
    files = os.listdir(start_path)
    files.sort()
    for i, file in enumerate(files):
        path = os.path.join(start_path, file)
        is_last = i == len(files) - 1
        if is_last:
            print(padding + branch + '└── ' + file)
            padding += '    '
            branch += '    '
        else:
            print(padding + branch + '├── ' + file)
            padding += '│   '
            branch += '│   '
this is JavaScript also don't roast someone, or i will start a argue
ZZZDUD
New Scratcher
100+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

WojtekGame wrote:

ZZZDUD wrote:

WojtekGame wrote:

ZZZDUD wrote:

Is this thing running on a potato! It took 54.4 seconds for it to run inside the VM (Safety first ofc)
note that i'm a regular Node.js user and not tested it in different systems.
Your code is so slow. Even this would be better
import os
def good_tree(start_path, padding='', branch=''):
    if not os.path.isdir(start_path):
        return
    files = os.listdir(start_path)
    files.sort()
    for i, file in enumerate(files):
        path = os.path.join(start_path, file)
        is_last = i == len(files) - 1
        if is_last:
            print(padding + branch + '└── ' + file)
            padding += '    '
            branch += '    '
        else:
            print(padding + branch + '├── ' + file)
            padding += '│   '
            branch += '│   '
this is JavaScript also don't roast someone, or i will start a argue
I am not roasting. I am just telling you a fact about your code. Sorry. Also why start argument? Likely mute or possible ban. Anyways, back on topic. I was just using Windows 9, It shouldn't run 40-75 seconds on Windows 9 if it runs 1-7 seconds on Windows 10?
DifferentDance8
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

ZZZDUD wrote:

I am not roasting. I am just telling you a fact about your code. Sorry. Also why start argument? Likely mute or possible ban. Anyways, back on topic. I was just using Windows 9, It shouldn't run 40-75 seconds on Windows 9 if it runs 1-7 seconds on Windows 10?
…how are you using Windows 9? Do you mean Windows 8.1 or something like that?
ZZZDUD
New Scratcher
100+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

DifferentDance8 wrote:

ZZZDUD wrote:

I am not roasting. I am just telling you a fact about your code. Sorry. Also why start argument? Likely mute or possible ban. Anyways, back on topic. I was just using Windows 9, It shouldn't run 40-75 seconds on Windows 9 if it runs 1-7 seconds on Windows 10?
…how are you using Windows 9? Do you mean Windows 8.1 or something like that?
In the VM it says Windows 9 but it looks more like Windows 7. I don't know, Maybe it's a modded version of Windows 7?
WojtekGame
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

ZZZDUD wrote:

WojtekGame wrote:

ZZZDUD wrote:

WojtekGame wrote:

ZZZDUD wrote:

Is this thing running on a potato! It took 54.4 seconds for it to run inside the VM (Safety first ofc)
note that i'm a regular Node.js user and not tested it in different systems.
Your code is so slow. Even this would be better
import os
def good_tree(start_path, padding='', branch=''):
    if not os.path.isdir(start_path):
        return
    files = os.listdir(start_path)
    files.sort()
    for i, file in enumerate(files):
        path = os.path.join(start_path, file)
        is_last = i == len(files) - 1
        if is_last:
            print(padding + branch + '└── ' + file)
            padding += '    '
            branch += '    '
        else:
            print(padding + branch + '├── ' + file)
            padding += '│   '
            branch += '│   '
this is JavaScript also don't roast someone, or i will start a argue
1.Also why start argument? Likely mute or possible ban. Anyways, back on topic.
2.I was just using Windows 9, It shouldn't run 40-75 seconds on Windows 9 if it runs 1-7 seconds on Windows 10?

1. this is a bad idea to say “your code is so slow”, IT'S FREAKING JAVASCRIPT!!
2.
PPPDUD
Scratcher
1000+ posts

code-gui - Npm package allowing contents of a folder with a Terminal UI!

ZZZDUD wrote:

DifferentDance8 wrote:

ZZZDUD wrote:

I am not roasting. I am just telling you a fact about your code. Sorry. Also why start argument? Likely mute or possible ban. Anyways, back on topic. I was just using Windows 9, It shouldn't run 40-75 seconds on Windows 9 if it runs 1-7 seconds on Windows 10?
…how are you using Windows 9? Do you mean Windows 8.1 or something like that?
In the VM it says Windows 9 but it looks more like Windows 7. I don't know, Maybe it's a modded version of Windows 7?
What?? I want a screenshot.

Powered by DjangoBB