« first day (3336 days earlier)      last day (1595 days later) » 

1:00 PM
so minify your code, add ingored operators to confuse people, add zalgoed comments, and RTL it... theres something thatll piss someone off trying to read code
Why did I do things like this
just... why lol?
 
oh there are some horrid things you can do to javascript code that still works
 
teach me so I can bring back the evil self I had years ago and bring hell down upon the javascript programming community with my ugly code straight from the bowels of hell
 
well you can transform javascript code into emoticons
 
oh god..
 
1:05 PM
that's both hilarious and impossible to read
it actually runs too
 
:P
 
Ive actually seen webpages that set all their sources to null(0) somehow
removing all references to their original JS
and you cant find it anywhere
and... even page source comes up empty
assuming thats a PHP thing though
 
they just remove their <script> tag once it got read.
but you cannot foul page-source
 
@KarelG hmm, is that reliable?
 
then is it a server sided script?
 
1:07 PM
you could simply disable javascript
then the javascript couldn't run and delete itself
 
what is the difference between plus and dash sign when you do npm list?
 
@user14492 Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
e.g.
```
+-- jade@0.28.1
| +-- coffee-script@1.4.0
| +-- commander@0.6.1
| `-- mkdirp@0.3.5
`-- ws@7.2.0
`-- async-limiter@1.0.1
```
 
Neil...
 
It's just supposed to show branching, I guess
 
1:08 PM
so it is installed?
 
@Neil the presence of <script> tag is to instruct the browser to interpret its body. It gets then represented in statements placed in the virtual memory (js machine). Then you can remove the script tags afterwards. It is a silly practice because the script can be re-read again by checking page source
 
What if I use the URL hashing ability as my zalgo generator
and then RTL the whole URL
 
I guess so, yes.
 
wouldnt that be anoyying to see your URL bar just like.. exploding
 
does anyone know what this error means:

```
Wed Dec 04 2019 13:03:04 GMT+0000 (Coordinated Universal Time): Application has thrown an uncaught exception and is terminated:
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (D:\home\site\wwwroot\node_modules\ws\index.js:3:19)
 
1:09 PM
I really come up with strange things to do in this language
 
@KarelG right, so it's a bit like preventing right click on images to prevent them from being downloaded
 
> This command will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree-structure.
 
@user14492 Have you read the error?
 
people trying hiding their javascript code are silly. I just do media1.giphy.com/media/CHYjhfBd34tCE/giphy.gif
 
to anyone with a bit of js experience, completely worthless
 
yeah.
 
What's unclear?
 
why it's showing
 
@user14492 Because you have a syntax error
 
typeof null
 
1:10 PM
You, or one of your dependencies
 
> SyntaxError: Unexpected token
 
no. i don't because I run the same code in my machine and it runs.
 
@user14492 You, or one of your dependencies.
 
then it is a problem in your modules
 
Oh shit, it's two mods in one room O-O
 
1:11 PM
D:\home\site\wwwroot\node_modules\ws\index.js:3:19
 
@geisterfurz007Stopthischaos The center cannot hold
 
^ possible cause
 
He comes
 
@user14492 if it were exactly the same, then it would be the same machine run at the same moment
 
models are also installed since it ` means it's isntalled
 
1:11 PM
ooo madara is a possible cause 😀
 
||> console.log(typeof null);
 
@TaylorS undefined Logged: "object"
 
something is different. find out what. Don't assume it can't happen because you will get exactly no where
 
WHAT
BUT ITS NULL
 
A wild Benji appears
@TaylorS typeof makes no sense
 
1:12 PM
ooh. thanks. i never thought about find out what was causing it...
 
||> console.log(typeof null, typeof undefined, typeof [], typeof {}, typeof (() => {}))
 
@MadaraUchiha "SyntaxError: Malformed arrow function parameter list" Logged: ``
 
@TaylorS check specs
 
@MadaraUchiha undefined Logged: "object", "undefined", "object", "object", "function"
 
perfectly defined and as expected it is "object"
"null" does not exist in js
it is just an empty box.
 
it is a box and it exists. But just empty.
undefined however cannot be represented as a box
 
@Neil I had this way too often today already...
 
undefined: there is no box
 
@geisterfurz007Stopthischaos and no layman will ever understand why you are happy that you got a different error :D
 
I am not. I left the office to read for half an hour once because I played that game with Jest and Babel configuration on a React Native app for 2.5 hours only to end up at the error where I started.
 
1:15 PM
@Neil Friend of mine suffers from chronic headaches, he told me he went to this therapist for some alternative treatment, and the type of headache changed, I told him "Good! You tried something and got a different error!"
Lucky he was a dev too, else he would have probably not appreciated it as much :D
 
Yeah, that'd have sounded outright douchy to someone who doesn't understand the joke :)
 
I have chronic knee pain :3
My bones are fucked up lol
chronic headaches though
ffs Id rather die
@Neil Attach this to a website as a userscript/bookmarklet
(function() {
    var s = document.createElement('style');
    s.textContent = '.trololol:hover{-webkit-transform: rotate(180deg);';
    document.head.appendChild(s);
    document.body.classList.add('trololol');
}());
try using github
imagine someone attached this as a malware payload to your browser
 
The good thing is that the code doesn't spoil the surprise :P
 
I found that here, rlemon made it
Jesus fricking hell... Try this one:
javascript:function r() { return Math.floor(Math.random() * 255); }function fakk(){ this.style.color = ['rgb(',[r(),r(),r()].join(','),')'].join(''),this.style.backgroundColor = ['rgb(',[r(),r(),r()].join(','),')'].join(''); }[].forEach.call(document.all, function(item) {    setTimeout(function() {fakk.call(item)}, (Math.random()*500)+100)});
lol it will scare you
 
1:25 PM
 
Hi All
i have to complete a task for interview on node.
I have a file in my solution, names of the user.
Now i want to get the list of repositories on git for the users which are there in the .txt file.
.txt will have comma separated names like abc, pqr, xyz
how can i do this?
do i need to loop through the names one by one and append the response to a object or i can also pass the array of user names to get the repositories
 
@geisterfurz007Stopthischaos staggeringbeauty.com (fair warning)
 
@Neil A classic
 
@Neil a classic
 
1:32 PM
yep
 
god. loved it again
* see me shakin' and getting some seizuuuureeee *
 
first time I went to that site, I think I damn near had a heart attack at 13 years old
 
I made it much worse
MUCH much worse
its a double interval to automate and slowly speed it up more and more
 
and misspelled seizure c:
 
I know
thats the point C:
cuz Im having a storke... stroek on purpose
 
or maybe it's drain bamage
 
Im BAMAGING the DRAIN
 
I'm not as think as you drunk I am
 
@TaylorS those variable names are worthy of level of sillyness
 
neil youve really brought out the inner psychotic child in me today.. and youve given me a stroke
drunka s what???
 
1:37 PM
🅱️rain 🅱️amage
 
@TaylorS oh dear what have I done?
 
yall are gunna make me LOL in math class and ima get sent to the officce
 
@Neil unless a different js adds the other js and then deletes it XD
@KarelG oops
 
@JBis not if the js isn't run
 
I sent the seizure to my friend in class, hes going to send the bookmarklet to other people
Wonder whats going to happen later on today lol
 
1:40 PM
the plugin or the site?
 
both
Im quite well known in my school, but they more or less believe Im a hacker than a programmer
 
someone will get a seizure, it will be tracked back to you and you'll get in trouble.
 
eh, problem is if someone has a low tolerance to seizures, that'll induce it for sure..
 
the last time I sent a javascript project out, I called it my "website unblocker" when it was really just a URL redirectory that sent you to a google cache:url
 
you may get in trouble even if you write seizure warning first
 
1:42 PM
you can place cache: to find archives of sites
google archives are unblocked, but people caught on fast
they still used it though
school never found out :P
 
@SamSam if you are asking how to get an array of names, you can simply use fs to read the file and then .split(",") to get an array
 
> #!/bin/sh
while [ true ]; do
echo "Sorry!";
done
Canada.sh
that rlemon
 
@JBis no, actually that im succesfully able to do
const express = require("express");
const app = express();
const request = require('request');

app.listen(3002, function () {
    console.log("Server running on port 3002");
});

app.get("/getUserRepository", function (req, res, next) {
    var fs = require("fs"),
        path = require("path"),
        rootDir = process.argv.length > 2 ? process.argv[2] : process.cwd()
    userListArray = [];
    filePath = path.join(rootDir, "userList.txt");

    console.log("before readFile");
    fs.readFile(filePath, {encoding: "UTF8"}, function (err, templateResponse) {
 
@Neil yes Sorry!
#ez
 
1:47 PM
cd /
sudo rm -r *
echo "Everythings okay now!"
 
wrong quotes in the end
failed
 
Shitty keyboard lol
 
Sure, it was the keyboard (:
 
:)
 
the first problem here is, as readFile is a async function, before it is getting complete the execution is moving to the next code
 
1:49 PM
I remember when I was replacing my raspberry pi 16gb card with a 64gb card, so I ended it with a bang
I sudo rm'ed everything with -r * on the base
 
@SamSam holy require inside of a function
Nopenopenopenopenope
 
halfway through deleting system bins I pulled the plug
 
@SamSam Welcome to async.
 
:)
 
@MadaraUchiha this is just a pseudo code. i will move that up.
 
1:50 PM
@MadaraUchiha pf, it uses var. Doesn't matter whether in function or not :P
 
fs.readFile is async so it will move on to the next code. console.log("after readFile"); will always run before console.log("readFile completion");
 
@SamSam Why? Why would you even write like that to begin with?
@geisterfurz007Stopthischaos Of course it does, require() is synchronous IO
 
Oh come on, you with your fair arguments all the time <.<
 
While it is not illegal to call require() from anywhere, doing it anywhere except for the top level of a module is what's considered a "pro gamer move"
 
const express = require("express");
const app = express();
const request = require('request');
const fs = require("fs");
const path = require("path");

app.listen(3002, function () {
    console.log("Server running on port 3002");
});

app.get("/getUserRepository", function (req, res, next) {

    var rootDir = process.argv.length > 2 ? process.argv[2] : process.cwd()
    userListArray = [];
    filePath = path.join(rootDir, "userList.txt");

    console.log("before readFile");
    fs.readFile(filePath, {encoding: "UTF8"}, function (err, templateResponse) {
a pro gamer move ;)
 
1:51 PM
Better
 
bruh.. I spent a day not paying attention talking in here
 
Sam, do you understand my comment above about fs.readFile being async?
 
my A grades in math went to a 69
RIP
Im so dead
 
@JBis yes, but then how do i achieve that.
 
1:52 PM
Should be a lesson; this chat is horrible :')
 
@TaylorS ctrl+W
 
Our teacher makes homework like 90% of the grade lol
I know I know
cya guys
Ctrl+w
 
I used to spend my time in math class writing programs into my TI-83 calculator to solve it
 
@SamSam tbh I hate the fs module. I usually use the fs-extra module. It (among other things) promisifies the entire fs module.
 
I did it before the math teacher finished explaining the assignment usually, leaving me to do all my homework simply by punching in the numbers :P
 
1:55 PM
but basically you would do this:
 
Does that imply mathematical failure or mathematical mastery? You be the judge
 
1. before the next code is executed, the file reading should complete.
2. will i have to loop through each item of the userList array and append the response?
 
@JBis hmm, there are promisey read functions in fs
and writes
 
@JBis actually thats not for a project implementation, but my interview assignment
 
all of these without Sync in it are async and promisy
 
1:56 PM
app.get("/getUserRepository",  async function (req, res, next) {
    console.log("before readFile");

    await new Promise(resolve => {
             fs.readFile(filePath, {encoding: "UTF8"}, function (err, templateResponse) {

                   userListArray = templateResponse.split(",");
                   console.log("readFile completion");
                   resolve();
        });
         });
        console.log("after readFile");

    });
 
@JBis Or you could just use fs.promises
 
@MadaraUchiha The "among other things" is another reason I use it.
But thats good to know thanks. When was that implemented?
 
@JBis 9 or 10 IIRC
 
this is what i get as exception
ReferenceError: await is not defined
 
what-do-you-get ??
._.
is your function really accompanied with async beforehand? <.<
 
2:08 PM
welp im back
I didnt pay attention in math but it turns out I did well enough to finish my work quickly
and apparently i accidentally did yesterdays homework without even knowing
so my grade should pop back up
 
don't neglect your studies in math
if anything, make a program that does it for you :)
at least it'll keep it interesting
 
lol
I actually tried that once
making a math interpreter like symbolab: symbolab.com/solver/equation-calculator
but
its VERY difficult
I could make sequence solvers, geometric sequence, arithmetic sequence, all these other algebras formulea
but itd never be in 1 calculator
 
yeah, writing a parser is rather difficult
it doesn't have to be a freakin' parser, just has to do your homework for you
 
yeah.. not fun
iikr
 
@Neil the PISA tests of my country has gone worse :|
 
2:12 PM
I did make a fun little parser one time that converted math symbols like ^7 to actual powers and stretched ( and ) to fit forumals
 
lower score than 3 years ago 😕
 
it was basically an improved MathML
 
and more less than 3 years before that
now politics and people are rambling about that
 
@KarelG I think that's mostly universal :(
 
yeah
 
2:13 PM
making math visualization is also very difficult too though
 
@TaylorS in code or in general?
 
have to make custom parenthesis and miniature canvases to fit little adjustments
in HTML and JS its difficult
some languages by default have awesome visualizers
 
if you have a formula, you can just punch in x values and mark it on a graph
 
I think markdown has its own equation visualizer
 
Or you integrate with MathJax
 
2:14 PM
I tried math libraries
none of them actually seemed to function at all
 
@SamSam make sure to add async function (req, res, next)
 
even the polyfills for mathML
none of them worked for me
brb switching to robotics class
 
So much for CTRL+W
 
What? I finished my work
besides, im in robotics (IT) class now
 
how can i install es6 on my node project?
as all the arrow functions, promises are throwing exceptions
 
2:26 PM
Update your node version because it's massively outdated.
 
hah ben
I still have the old version on this pc
 
I have nvm installed :')
 
PS C:\dev> node -v
v6.9.5
 
lemon is still on 0.10 on his embedded stuff
 
that's the first node release? haha
nice
 
2:32 PM
I got bored a couple days ago, and I made a winform thats standalone and can convert websites and HTML files to electron apps pure automatically
it even auto downloads electron and electron builder if you choose to
it was a pain in the ass to make lol
 
There's like a billion apps that do that, where's the innovation
 
it's hard finding an app that has innovation
 
Nowhere
I just wanted to convert some of my javascript games to apps
 
well no, that's not true. It's hard thinking up an app that has innovation
 
and I was sick of making em manually
I actually havent found any apps that prebuild full websites into packaged and standalone EXE files
 
2:34 PM
the best you can hope for nowadays is taking an existing app and improving upon it somehow
 
except nativefier, but that just packs an html file with an iframe to a website
and it doesnt make portable exes
 
nobody wants that
it's a website for a reason
 
eh
convert your netflix site into a netflix app :P
convert github online into github desktop XD
 
but why
 
because its fun
I do stupid shit because its fun
maybe one day ill be an actual software engineer or web developer
but im 14... I wanna enjoy life
 
2:36 PM
I'm trying to bundle my application with webpack which has a dependency on a third party library which has require("something.wasm") in it. The result of the require is passed to a script block which loads it. In the example of the library I'm trying to bundle I see that require("") returns the path the wasm file can be loaded from. However on my machine after webpack packages it, I get an object with { "default": "the path to the wasm file", __esModule: true } in it.

It seems that the library expects the require("") call to return the string the wasm file can be loaded from, however a mod
 
@TaylorS not true
I hope that you would change a lot before you step into the IT industry
 
> Here's some extra overhead for no benefit, enjoy!
 
Well, Im going to have to change
I still got 3 years ahead of me in highschool
not to mention college
and im already learning 2 framework languages and 4 actual programming languages
I think ive gotten a good start
 
I am having a Shrödinger application atm. HeidiSQL is not responding but db traffic shows the request is still active and in process. 🤔
so is it really waiting for the response or did it really break?
 
@Wouter Do you have a loader capable of resolving your wasm require?
 
2:44 PM
Hey im curious, can you execute Bookmarklets with javascript?
like in a url request
if so, you could technically use it to send data to the page outside the iframe
or even change the style
 
@TaylorS you need to figure out what a bookmarklet is. if you find an answer, you know that this question is kinda obsolete
hint: <a href="javascript:...">
 
below is my updated code, and with this im able to control the flow of execution
const express = require("express");
const app = express();
const request = require('request');
const fs = require("fs");
var path = require("path");
var async = require("async");
var rootDir = process.argv.length > 2 ? process.argv[2] : process.cwd();
var filePath = path.join(rootDir, "userList.txt");


app.listen(3002, function () {
    console.log("Server running on port 3002");
});

app.get("/getUserRepository", function (req, res, next) {


    console.log("before readFile");

    console.log("file path " + filePath);
 
I have the { test: /\.wasm$/, loader: "file-loader", type: "javascript/auto" } block, and I see the wasm file in the dist directory + the {"default": "the path" } is valid.

The behavior is differnet
 
well @KarelG I know its basically a userscript run on a lightweight JS interpreter
but its not technically a form of URL
 
2:49 PM
it's not an user script
 
but that URL is also interpreted by the same browser, so shouldnt it result in the same execution?
 
the problem im facing now is, im not able to access the filePath variable declared at the top. can someone please suggest any alternate of how i can do that.
 
@SamSam Not that async..
@Wouter You still need a way to run it, developer.mozilla.org/en-US/docs/WebAssembly/…
 
@BenFortune ??
 
Your file loader is literally just copying the file to the output dir
 
2:54 PM
3
 
@Clarity Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
What a way to enter a chatroom :D
Welcome!
 
Hello! :)
 
@TaylorS that is not an URL. Sure it can be an url so that it becomes a hyperlink, but for the browser it is just a plain text
 
Don't be weird
1 message moved to Trash can
 
2:59 PM
when you click on it, it determines what to do with it. There, it happens what happens. If the string is an url, then it navigates to it (as acting as a hyperlink)
I recommend to dig in the specs what would happen behind the scheme if an user click on <a href="..."> (or your bookmarklet)
it is just protocol|behavior:actionData
like mailto:mail@address.com
using javascript:voodoo tells the browser to run context as javascript and invoke it as a task (being put on the task queue)
 
@BenFortune I get that, my problem is that:

In their example
const onigasmPath = require('onigasm/lib/onigasm.wasm'); returns "f8f821a66b20e5801e35df5ec4565b30.wasm"

in my case:
const onigasmPath = require('onigasm/lib/onigasm.wasm'); returns { "default": "some_hash.wasm", __esModule: true }

and I don't understand why.
 
because you're using require
try import
 
I know what protocol URLs do
 
or require('onigasm/lib/onigasm.wasm').default;
 
but they work as hyperlinks
 
3:07 PM
it is in a typescript library that I do not own.
basically I copied an import ...ts from a project, and included the third party dependency.

However in their case the require("") in the dependency returns a string, and in my case a module.
I get that import would be the preferred way.
somehow I guess webpack decides to handle it differently
 
Their example gives import { loadWASM } from 'onigasm'
I'm lost on what you're trying to do, are you including the dep in your webpack export?
 
Basically I have a project with a dependency on github.com/eclipse-theia/theia/blob/… . They have an example project where that call returns a string "....wasm". That example project is also packaged with webpack, and has the same wasm rule.
However in my local project, where I import that same file, which is also packaged with webpack (with the exact same wasm rule), that call returns a module object. I don't understand why webpack decides to handle it differently.
does that make it more clear?
 
3:30 PM
Sadly I have to leave for home. If anyone has any clue, please let me know.
 
fyi, i updated the bot to edit gifs after 60 seconds to prevent teh annoyance
 
60 seconds?
reasonable :P
 
user6276743
Trying to make a reader where users click a button to navigate to the next page, which is loaded from MySQL via JS, AJAX & PHP, so the page is reloaded without refreshing. How do I prevent users hijacking JS + AJAX via the console and downloading the whole book? Pretty sure there's already an answer to this, I'm just not searching the right terms...
 
@WeavingBird1917 Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
3:46 PM
@JBis I updated my bot to edit every onebox after 110 seconds to prevent teh annoyance
both messages of Wietbot and me :D
cause I am a lazy bastard
(bot isnt running tho)
 
How does it edit yours?
 
it edits my messages because it logs in as me :D
sendMessage and editMessage are just api calls
depending on which user sent the message, the bot uses a different login mechanism
I could technically do it for everyone, but people would have to send me their password
so...
or I would need special permissions...
 
4:40 PM
@Neil you are just not creative enough ;)
Does anyone know how Cap's suggestion dictionary worked?
 
Just use levenshtein
 
4:57 PM
thats smart
thanks
 
user7659542
5:34 PM
I am trying to trigger a php script using this javascript function, but it doesnt work
 
user7659542
function getAllFormsData(){

    var length = document.forms.length;
    for(var i = 0; i < length; i++) {
        if(document.forms[i].id == "cmsForm") {
            form = document.forms[i];

           /* POST information obtained via js to PHP script. */
           var httpc = new XMLHttpRequest();
           var url = "127.0.0.1/cms.php";
           httpc.open("GET", url, true); /
           httpc.send(form.newTxt.value)
        }
    }
}
 
user7659542
Any suggestions?
 
6:13 PM
Well, do you have any errors in your console? Check the network tab; are you seeing a 404?
"doesn't work" isn't enough info to go off of; we need to know if you have any errors
 
6:32 PM
So I have something like this: `jQuery('.form--ssn-submit', namespace).one('submit', function (e) { //a few api calls});`

It use to be .on I switched to .one() but now when I spam Enter it doesnt submit. Which is was the workflow that was the issue as it would submit the call multiple times
Thoughts?
 
.one registers the event handler once, so after it has been called, it removes the listener.
Probably not what you want
 
i mean
.on also registers the event handler once
 
@traducerad Yup: Don't iterate over the forms to find something with your id. You can use document.getElementById("cmsForm") for that. But that won't solve your problem. What does "doesn't work" mean?
 
@user400654 Yes, my wording was bad, hopefully you understand what I meant
 
.one is an adequate solution if the form should never be submitted again... until another action rebinds it. but if you're just going to re-bind it, you mightaswell just use .on and instead simply do nothing if a current submission is in progress.
 
6:38 PM
From what I can tell the code Im working on is calling jquery.post to validate an SSN then if it matched it calls a .post to pull stuff into a list. When a user spams the button it ends up filling the list up with more than we want.
@user400654 Could you point me towards an example of the second thing you mentioned?
 
do you have a link to that duplicate post you mentioned yesterday?
or was that monday
 
Tbh not sure. Let me get the gist
 
because it had an example
164
Q: Prevent double submission of forms in jQuery

AdamI have a form that takes a little while for the server to process. I need to ensure that the user waits and does not attempt to resubmit the form by clicking the button again. I tried using the following jQuery code: <script type="text/javascript"> $(document).ready(function() { $("form#my_f...

the "jquery plugin" in the accepted answer essentially does what i was suggesting
 
I see I see, Ill give that a shot. Very little experience in JS anything so hard for me to know what to look into
 
My ultimate recommendation here, which is just going to confuse you, would be to ditch jquery alltogether
 
6:45 PM
haha not wrong but sadly this is a legacy app that I cant rewrite in this sprint
 
fair enough
 
 

« first day (3336 days earlier)      last day (1595 days later) »