« first day (3330 days earlier)      last day (1621 days later) » 
00:00 - 20:0021:00 - 00:00

9:17 PM
In this video he uses yarn. What are peoples opinions on yarn vs npm?
I used npm before but yarn looks simpler? correct?
 
@Permian From what I know, yarn installs things in parallel npm does not. This only really matters for the initial install of modules after that it doesn't really matter.
 
ok
so yarn better
 
I use npm because its one less thing that i have to install.
 
thanks guys
 
np :)
 
9:22 PM
@geisterfurz007Stopthischaos say what
if you write me a function in JS to evaluate JS, I will make an evalNode in Wietbot
or anyone for that matter
 
Hand eval js? Thats the most secure way.
 
what ide was the guy that video using?
 
hand eval js?
it doesnt need secure
just allow everything
allow require, allow shutdown, allow http client, allow everything
 
@Permian atom maybe?
 
cool
 
9:25 PM
don't use it
 
looks a bit like vscode
 
VSCode
 
use Webstorm or VSCode
Or if no IDE use sublime
 
ive vscode i think
 
@JBis it is a bit more than just use eval tho
I basically made these rules for all eval features
request:
{ "code": "2 + 3" }
response:
{ "result": "5" }

request:
{ "code": "console.log('5')" }
response:
{ "result": "Result: undefined\r\nOutput:\r\n5" }
the input and output are always json
 
9:27 PM
shouldn't the output for the second be
{ "result": "undefined", "output":"5" }
 
could be
 
i am missing something between react, bootstrap (html+css)
 
should be
 
I made the evaluators responsible for that tho
 
because my websites look crap
are there good component or graphics packages you need to use?
 
9:29 PM
that way, the in-out stuff of their api is easiest
 
I don't like react. I don't know how to use it properly also.
 
well react is popular
 
@Wietlol i still have my doubts about your eval
@Permian so is meth, doesn't mean its good
 
what do you like? @JBis
 
what doubts?
security?
or api?
 
9:30 PM
@Permian I like backend. But for frontend i usually just use straight html/css/js.
 
I use react for front end, but I dont use js tho :D
 
what websites do just that?
 
so, I am probably not able to help you
 
@Wietlol why?
 
because I am not the biggest JS fan
 
9:31 PM
Well your API should def split up result and output and both should exist for all outputs but thats easy to fix. I still have doubts about the security.
 
@Wietlol why use react then?
 
@Wietlol how?
 
@JBis you can leave the security to me
 
@Permian idk, plenty
 
I made the environment responsible for security, not the library that executes the code
 
9:32 PM
@Wietlol what are you proposing?
 
the environment can be reused, the library differs for every language
 
@JBis how do you make it look good? im missing something
 
so for every language, I have to find out how to do security
 
mine just look like 90s websites
 
instead, I only have to figure out the security once and then simply make the implementations for each language
@Permian because I think react is one of the best UI frameworks currently available
@JBis I use Kotlin
 
9:33 PM
@Wietlol why if you dont use js?
 
@Permian Send me your website. I'll take a look. TBH I copy aspects of other sites I like. My biggest issue is colors, which are really easy to steal. Create a custom palate.
@Wietlol ah. Didn't know you could do that
 
@Permian I think react is the best, I dont think JS is the best
 
@JBis they are on my old laptop (which i dont have). will try again soon. How do you copy other websites?
 
React is only good for some types of projects.
 
@Wietlol what is the gain from react if you dont use js?
 
9:34 PM
I use a different language
 
@Permian Inspect element
 
with react
 
@Permian he uses a diff lang that generates react code
 
I write react code... the comiler generates the JS :D
the difference between kotlin react and js react is that in js react, you have two languages in one file, js and html, in kotlin react, you only use kotlin, because kotlin is nice like that
 
@JBis what are you looking for?
 
9:36 PM
I am saying you can use inspect element to look at how website is built, etc.
 
i thought a lot of it was still hidden
 
no
 
|| mdn inspect element
 
9:37 PM
^
 
im in firefox
the scripts are still hidden
 
the scripts aren't what you should be looking at
 
what should i be looking at
?
 
its the html and css and the general design. Wheres the nav bar? How is it structured? etc.
for example:
 
i clicked inspect element on the "a beautiful double room in London"
 
10:22 PM
can anyone halp me write a little function?
 
sure
what do you need?
 
exports.handler =  async function(event, context) {
  // event = { "code": "2 + 3" }


  return result // result = { "result": "5" }
}
 
@Wietlol Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
the body :D
I know it is just eval, but I want the console logging to not actually go to the console, but instead to the result
as mentioned before
also... the eval stuff must support async
 
10:30 PM
what is with the undefined stuff in exec?
 
Idk, Zirak did it so I did too
 
exports.handler = async function(event, context) {
    const console = {
        _items: [],
        log: function () {
            console._items.push.apply(console._items, Array.from(arguments).map(e => JSON.stringify(e)));
        }
    };
    console.error = console.info = console.debug = console.log;


    let result = exec(event.code);


    let stdOut = console._items.reduce((l, r) => l + "\r\n" + r);
    if (stdOut === "")
        return {result};
    else
        return {result: `Result: ${result}\r\nOutput\r\n${stdOut}`};
so basically like that?
(apart from the exec stuff)
 
10:54 PM
sure except no
return {result: Result: ${result}\r\nOutput\r\n${stdOut}}; this is just stupid
but for your console question, yes. Note: technically the eval code will have access to the variable and could modify it
console._items.reduce((l, r) => l + "\r\n" + r); god no
use join
|| mdn join
 
console._items.join("\r\n")
||> ["Foo","Bar"].join(" - ")
 
@JBis "Foo - Bar" Logged: ``
 
@Wietlol
 
ooh, join ofcourse
 
10:59 PM
do note the following:
const a = {}; a.toString = () => { eval("process.exit()" }; console._items.push(a) boom i hacked your program
hmm, maybe i hacked mine too
 
that is perfectly fine
well... that worked
 
00:00 - 20:0021:00 - 00:00

« first day (3330 days earlier)      last day (1621 days later) »