« first day (3413 days earlier)      last day (1518 days later) » 
02:00 - 14:0014:00 - 23:00

2:01 PM
What's the advantage of screen-size tags vs. media queries in CSS?
 
@TaylorS for now i'll keep it like that , i dont think this is the best way to do it
 
You may need both the viewport meta tags and CSS, depending on what you're trying to achieve
 
2:17 PM
viewport... to center? um
maybe not
viewport is nice for responsiveness, but its not really good for static measurements
it screws with fonts in the sense that trying to make a font responsive like the size? well
if its set to work on phones, its too big for computers.

if its set for computers, then iits too small for phones
 
i'll admit, I've never been that great at css
 
:P
 
I usually just look up tricks on how to do it online
at least I know not to use !important everywhere :)
 
Neither have I, but I've picked up a couple tips, tricks, and just generally No-nos on my way
Ugh I never use !important lol
 
Same here. For most stuff, I play w/ it in browser dev tools until it works
 
2:21 PM
I think of it as a cheat
 
there are nice tools online for being able to test your site with different resolutions
 
!important is for that situation where your CSS selectors arent set correctly location-wise, and you have to force it to use a specific style
Yeah
 
I just use those mostly
 
What tool do u use for Safari testing?
Free, I mean
 
My phone
:P
 
2:22 PM
:D
 
I also have an ipad, dads got an ANCIENT macbook
those work too
 
I've heard of installing a mac os iso on VirtualBox
 
I thought there was a safari for windows
 
Used to be
 
virtualbox for a browser?
No way
I would just emulate the browser
 
2:23 PM
@TaylorS I saw someone on reddit arguing for the creation of a !!important to override existing !important values XD
 
too much space and ram, other used up resources just for safari browser
 
ipad might be the only good option
 
honestly all you have to do for safari is use -webkit-appearance: none; on inputs and set heights, other than that, most things work
 
I once relied on the use of data tags for a web page only to find out that IE 10 doesn't support it..
I mean really.. IE 10 doesn't support data tags..
 
Plus some kinks, but so far my basic sites all work fine on safari
 
2:25 PM
I was honestly surprised
 
Dude, IE doesnt support anything
Edge is basically just IE and Chrome's child
 
yeah but that's been around forever
 
Tells ya how much they care about it
 
!! sounds like type coercion
 
I think they held a grudge because they weren't the ones to come up with the idea
 
2:25 PM
Idek why people still want to support it for those 10 people from 1990 still using it
gotta take test, bye
 
New Edge is Chrome w/ MS smeared on it
 
it used to be that IE6 was the standard
 
@Neil you mean <data>?
 
@TylerH no, I mean like <tr data-id="123">
 
ah attributes
 
2:27 PM
I find those very useful
 
those are HTML5
 
IE was king in early '00's
 
of course I can still get around that by adding <input type="hidden"> everywhere
still ugly as sin though
 
Who remembers if(document.all){...}?
 
HTML5 didn't hit candidate recommendation status until like a year after IE11 was already out.
so it makes sense that IE10 wouldn't have much support for HTML5 stuff
 
2:28 PM
@Alex what did that do?
 
A cheat to do stuff for IE vs NS
 
ah because it was only supported in IE
 
Yep
 
@TylerH IE11 is not even compliant with HTML 4.01
 
Usually, they had three... next would be else if(document.getElementById(...
 
2:30 PM
Is there someone who has knowledge about TS > JS conversion? chat.stackoverflow.com/rooms/208129/…
 
@Klyner 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.
 
How did you guys add that bot? It's cool
 
@KarelG in which way?
 
I found a really cool cyber security college program that I may end up attending, so I'm in a good mood :)
 
@Neil lemme give me you a well-known problem: document.querySelectorAll('a').forEach(...)
IE / Edge says "prrrt"
 
2:31 PM
@Klyner take a look at the type script website
 
Because NodeList isn't treated like an array
why NodeList isn't treated like an array, I have no idea
 
@Alex I made it :) if you want to make your own you can join the testing room
 
@Neil live collection
the other browsers solved it by somewhat proxying it (as the standard described)
 
@JBis Keuhl. Let me see where that room is...
 
@Alex @TaylorS thank you guys
@Neil i'm like u i'm not good at css as well , life is complicated enough lol
 
2:33 PM
@diamond live on to fight another day, soldier
 

Test My Bot

A room for discussing and asking questions about SO/SE bot cre...
 
(aka static list)
 
Ray
Does vanilla js have an elegant way to accept a single object or an array of objects as parameters?
 
Found it
 
Ray
similiar to this
 
2:34 PM
Tnx
 
@Neil exactly ^^
 
@KarelG I didn't say anything about compliant, I said support for :-)
 
true that
 
Ray
10
Q: Accepting a parameter either as individual object or as array of objects

user2398029I have a bunch of functions that take in either an array of objects, or a single object designed to be treated as an array containing one object, and I am looking for a cleaner way to accomplish this. Basically, I want to know how I could make the unless part in the following function more concis...

 
big difference.
 
2:34 PM
Chrome latest isn't compliant with much of the specs, technically
 
tha's also correct
 
unfortunately these days Chrome is such a big name that the spec usually changes to comply with Chrome
 
that's usually what happens
the dominating technology determines the standard
with great power comes great responsibility!
 
@TylerH Doesnt chrome support the most of the Specs ATM?
You can use base css specs, almost any of them, same with JS and HTML
unlike the other browsers, which have issues with VERY basic features, like Percentages and CSS Variables
 
@Neil also "great irresponsibility" (sometimes)
 
2:38 PM
I still dont understand how people bash chrome
its been working well for me for years
 
@TaylorS what browser can't handle percentages?
 
ever since I started web programming, its never given me any problems
 
I don't use Chrome except at work
 
@JBis Firefox at one time was using Percentages like VW and VH
 
I'm on new Edge as well as FF/Chrome. Edge hasn't been locked down by org yet
 
2:39 PM
instead of parent width/height
 
I don't really like the change in policy they've made these years regarding privacy of data
 
People bash it because of googles data issues
@TaylorS ...those are two different things
One is relative to parent the other is to viewport size
 
Honestly I like chrome because all my accounts are tied to it, It was the first browser I used, and I gotta appreciate the latest themes and extensions
 
cries in data privacy
 
I've since switched to Firefox and www.duckduckgo.com
 
2:41 PM
@JBis exactly, VW and VH go off the window's width and height.

% goes off the parent elements width and height, yet a far deep child with % in firefox was going off the window width and height
 
I get that that's where everything is heading, I just don't want to contribute towards it
 
W/ the Equifax data breach, all our data's on the dark web anyway
 
Eh, Privacy? Idgaf
 
I switched to DuckDuckGo for about a month but it just wasn't as good as google. So I went back. But I use Firefox and a bunch of other anti tracking mechanisms.
 
I have my public name and age out on the public
like that was revealed years ago
 
2:42 PM
@TaylorS You are a trump supporter right?
 
idrc about the new privacy policies
Sorta? not really
I like the economy boost, I hate all of em really
the dems are just a little over the top rn though
so yeah, in a sense
 
@TaylorS source?
 
source? for what?
 
@Alex PII is not what I am talking about.
 
Were talking about a few things rn
confused
 
2:42 PM
PII isn't the problem
the issue is trends data
 
Yeah, what we surf to
 
Knowing your age and name and address doesn't tell me who you are as a person
knowing your search history does
 
I've noticed: search for a jacket on google, go to WashPost and there's an ad for jackets in the middle of the articles
 
yes
 
Ill admit, ever since firefox had an issue with my google firebase page, I do have it installed.

I still havent once opened it yet though.

Nothing wrong with it, it just feels unnatural since Ive been using chrome since I started playing flash games when I was like 5
 
2:44 PM
@Alex That's not an issue per se
 
@Alex Every browser does that.

When you check that "Send Statistical Data to our Developers" your allowing them to do that
 
@TaylorS no, vh and vw are based on the root element's initial containing block. This is usually equal to 'the window' but not always
 
Or so ive heard, if places DONT do that, they dont earn money
 
@TaylorS what no
 
the browsers are free... how do you think they get money? they sell your likes and data
 
2:46 PM
ahhhhh the misinformation is killing me
 
I might not be exactly right
Im not wrong though
 
@TaylorS no again, (besides chrome)
@TaylorS you are
 
@JBis come to europe
 
@TaylorS Yes, Chrome has very good support for stuff in the CSS and HTML specifications. What I said was that Chrome isn't compliant, which means there are cases where the spec says "do it this way" and Chrome's implementation differs from what the spec says. Whether that's a good idea or not is up for debate, of course, but it means Chrome is not compliant. My point in saying that was to point out that just because a browser is new doesn't mean it's compliant with specs.
 
@JBis did you know that never accepting misinformation is considered behavior of entitled people?

Please just accept for once that you could POSSIBLY be wrong
 
2:47 PM
I don't think any browser is fully compliant with every spec
 
@JBis fyi, firefox uses google analytics :D
 
How about Europe comes to us? We should Adopt Gdpr! I wrote an entire paper on the subject.
 
Karel noticed, GJ
Like I said, most browsers DO use it
 
that was a total mindfuck when I saw that patch
 
facebook admitted to using it
 
2:48 PM
fb has its own analytic services now
 
@KarelG where? On their website?
 
youtube, instagram, and pretty much any site thats in google firebase with google analytics attached, is basically in on it
 
just in the browser itself
 
@TaylorS Yeah that's not browsers
 
Different service doesnt matter, theyre all using some form of ad revenue service to consume your "likes and wants"
omfg, JBis browsers use it too, stop micromanaging lol
 
2:50 PM
@KarelG source?
@TaylorS Inaccurate information, misuse of the word "micromanaging", assumes facts not in evidence
 
@TaylorS statistical data collected by browsers is in no way related to ad delivery. Ad delivery and targeting is done via tracking cookies and JavaScript. You can control tracking cookies and JavaScript to an extent in most browsers, but still, that's a separate thing from statistical data. Statistical data is used by browsers to generate usage reports so they know who is using what feature and what types of specs people are running in their machines.
 
^
+ most of the statistical data is anonymous
 
@JBis check settings -> privacy and security -> Firefox Data Collection and Use
 
@JBis yes, by 'who is using what feature' I should probably have said simply 'what features are being used'
 
google probably gets access to any data passing through their system that way as part of the agreement
 
2:53 PM
@TylerH As far as Ive heard, google collects statistical data based on location and region, and supplies ads based on that
 
I honestly don't want to know what's in my file in some google database somewhere
 
so if your in america, and your searching for food recipes, you might get ads for a restuarant nearby
but if your in japan, searching for anime, might get pokemon ads or something XD
who knows at this point
truth is, they never release the actual data, because they cant, so none of us ACTUALLY know what they truly take
or sell
 
@TaylorS if you are in the EU they have to
and even if you aren't big companies allow data downloads anyway
 
not here, never once heard of these ad services releasing data
 
apple, fb, google etc
 
2:55 PM
now THAT would be a breach of privacy
 
Grrr
 
ad company secretly taking your data, then releasing it for anyone to see
 
No, not anyone
you have to be logged in
 
SOURCE?

So in the EU, they just take all your data and throw it at the public? Anyone can see it
:L
 
NO
You have to be logged in to download
Source: gdpr-info.eu
 
2:57 PM
> truth is, they never release the actual data, because they cant, so none of us ACTUALLY know what they truly take
> or sell

> @TaylorS if you are in the EU they have to
 
Wouldnt such a thing be illegal against their terms
Account Data? thats just cookies and things the browser stores thats in the google cloud?
Unfortunately as for the first site, its blocked
 
the problem is, even if you say, share all data about a user except his identify information, you can still use process of elimination to narrow it down to that person regardless
 
@TaylorS no
 
2:59 PM
hence, you can get around privacy laws
 
@TaylorS not our fault
@Neil yes, but GDPR isn't meant to address that.
 
google sells your data saying, "We can't tell you who he is, only that he accesses amazon at least three times a week, orders baby food, and has this IP address"
 
ffs, just want to have a lovely conversation about FRICKING JAVASCRIPT.

And this is why I hate politics, makes a normally nice person like JBis sound like one of those teenagers who arrogantly reply `Not our fault`
 
Which for all intents and purposes is giving away your identity in another way
all you have to do is log into another site with that same IP address and they can attach a name to it
 
Neil I know they do that, but Im saying if the public had access to search who is who and their data, it would be illegal
In most terms, they agree to not share your personal identity and data
 
3:01 PM
what a "rambling" here
 
Karel I wish we had never actually started it, but its kinda hard to end a good debate
 
as it stands now, nobody has access to who you are and what your data is except literally every business willing to pay for that data
 
Went from arguing about chrome/firefox AGAIN to Donald Trump, and now Privacy and international laws and bullshit.
 
just don't talk? You were like a gatling gun there :P
 
Lets just drop this before were all mad at each other for the rest of the evening
 
3:03 PM
sorry, I wasn't trying to argue one side or another, just making conversation mostly
 
@TaylorS you know the rules of this room. Topics are not limited to JS. You also know that as long as the debators are being respectful, debating and arguing is totally ok and in fact productive.
@Neil no need to apologize for contributing to an educational discussion
 
But when it comes to opinions or politics, things tend to turn to "No Im Right! NO IM RIGHT!"
 
@TaylorS if you, at any time, wish to cease participating in the conversation simply don't respond
 
So...
 
Obviously people think their opinions are right
 
3:06 PM
@TaylorS you're right, they do. When things get to that point, you'd be wise to remember that objective opinions can't be proven right or wrong
 
Im fine talking about my opinions, but when someone wants to bash it and say Im totally wrong, how else am I supposed to reply other than argue
 
so it's kind of pointless yelling "I'M RIGHT!" the loudest :P
that holds true for everyone involved
 
@TaylorS Because sometimes you confuse opinions with false facts
 
If only politics were like programming
pure solid facts everyone should understand... rather than opinions
 
@TaylorS Just say, "That's just like your opinion, man"
 
3:07 PM
@JBis They are false to you
 
"I think the sky is purple" "No, it's blue here's a picture of the sky as proof" "It's blocked and that's just my opinion"
 
So, to me, a flat earther seems unworldy incorrect and 100% wrong.

but in the same way your addressing that to me.

That flat earther will legitimately believe that opinion
it has to be respected as to not cause chaos
 
well objectively nothing can be resolved not even in a situation where one is stating something and one sees it as fact (false or otherwise) and the other as opinion
 
ok dont pull that website is blocked thing dude.. thats just rude. I cant control that
every news and blog site is blocked
the only reason programming sites are unblocked is because google tags them as educational or productive
and zscaler lets me use em
so if google tags a site as a game or blog, its pretty much permanently gone
 
No, but don't use inability to access information or proof as a way to dismiss
 
3:10 PM
when did I
 
...
 
I simply stated I couldnt access the information
 
let's take a break of 1 minute
 
I never said "Oh no! Look at that, cant access it, It must be outright FALSE!"
 
after now ⌚
 
3:12 PM
in that case, before were allowed to argue some more, I think Im going to go to codepen and forget this nonsense until tomorrow
Goodbye... And to the people who respected the opinions of others, hope you have a nice day :I
 
relax. honestly, nobody is attacking you, I promise
if I thought he were going overboard, I'd say something
some people may not agree with you, and the reasons for not agreeing with you may not be rational or logical.. you can't really argue against that :P
 
So, how's everyone day going?
 
about end of my work shift, so good :)
 
Tired, my brain got a stack overflow today.
 
Ouch
 
3:23 PM
:-) But almost holiday.
 
3:39 PM
boo github went down
was in process of writing issues <.<
(can't post something it seems)
 
4:01 PM
Hey, guys, I have a problem with one of the normal chrome behavior, I have a dropdown menu that changes the content according to what you select. the problem I have is automatic scrolling in chrome browser, how can I omit the auto-scrolling or jumping?
 
4:11 PM
@PooyaPanahandeh can you please explain I bit more? Maybe an example. I
 
4:23 PM
I have a dropdown menu, according to what you select, related content will show and URL will change, for exam URL is me.com and it would change to me.com#contact, the problem is when someone changes the value of dropdown menu it scrolls automatically
@JBis Now I want to prevent chrome from scrolling by changing the value of the dropdown menu
 
Wdym by scrolling?
 
So the DD menu shows/hides stuff on page, thus causing Chrome to scroll up/down?
 
@Alex yes
 
So you want to keep the page's scroll position after the selection
 
@Alex yes
 
4:27 PM
Ok, simply store the scroll location, switch the content, and set back the scroll location to the stored value
 
Use window.scrollTo
 
@JBis is there any possibility to disable this feature from code?
 
Or el.scrollTo
 
@PooyaPanahandeh no, because as the page content changes the page isn't as large which is why it "scrolls" up
 
4:30 PM
@JBis thanks for your time
 
Before selection, use this: window.pageYOffset to get position. Then after selection, set the position back to that: window.scrollTo(0, position);
 
@Alex thanks for your time
 
Sure
 
Not exactly JS related, but I'm implementing Square on a site of ours and am wondering something
I first send the payment off to Square. Next I take the response and store some of it in the DB, then mark the item as paid
My concern is that if something errors after sending the payment, I won't have a history of the transaction, and a user may try and pay again
 
It's called idempotent transactions
For it to occur once and only once
 
4:42 PM
Is there a way to reach out to square to verify a transaction?
 
They have a great API and should have a way to check that
 
If so, mark it as "processing" in your database, and then check back (maybe on a chron job) to validate processing transactions
 
Dang our git server majorly crashed.
 
At least in testing, the transaction completes instantly, so I can only store the transaction ID after it's completed anyways
 
Github was down earlier and now this?
 
4:43 PM
But I do pass an idempotency_key, so I suppose I can store that somewhere before starting the transaction
 
Yes, store it w/ the user's identifying data
 
That should work, thanks
 
Also, hit square up with that question too. They have a lot of customers w/ same requirement
 
It's not so much a concern with something on Square's end messing up, more something on our end
 
The idemp key is your friend in this case
 
4:51 PM
Just in case anyone has an idea and doesn't watch superuser: superuser.com/questions/1526712/…
"Why is using ssh considered to be safer than using https connections to a git repository when storing the credentials?"
 
5:04 PM
@paul23 that question maybe better suited for infosec
 
Looks unbiased, seems to fit superuser.

Its just a question about how SSH can be safer, I doubt theres anything wrong with asking it there
 
@paul23 couple reasons probably.
 
Well I can't really think of any :/
Both cases the data is encrypted while being sent. In both cases the "credentials" are accessible if the receiving pc is compromised.
 
1. SSH keys are often longer and more random then simply HTTPS credentials
 
Answer appeared
 
5:12 PM
hi, why would reading my xml generate a lot of question marks and weird combinations instead of my text
4???FG for example
 
Based on your lack of information, there's no way for us to know
 
@tahtoh Provide Code
"Talk is cheap, Show me the code" - Linus Torvalds, the original developer of the Linux Operating System.
 
@paul23 You can't really think about the PC being compromised. You have to assume it won't be and have other protections to make sure it isn't (like encrypting the entire disk).
 
I dont get how people always talk about PCs getting compromised, most viruses just encrypt or delete information, and the only way to really "steal" info is if the program directly sends out data (which can be specifically enabled and disabled per program)

and the other way would be a tech scammer directly connecting to the pc to gain access to files
then again Ive never "compromised" my pc, so its kinda unrealistic in my eyes
 
It is very useful if a part of your system gets compromised access is contained to only that part and the rest isn't involved in a domino effect.
 
5:27 PM
> most viruses just encrypt or delete information
[citation needed]
 
@TaylorS There are some very funny YT vids on folks baiting scammers to connect to their "PC" (actually a VM). Then they use Teamviewer to see the scammer's pc and syskey it
 
going from experience, remember Im the guy who never looks stuff up lol
Yeah ive seen those
pretty funny imo
 
They download their files/delete them, contact the victims
Anonymous is also in the act. They use autodialers to hit call centers
Each call costs a few dollars
So the scammers have to shut them down
Not that I condone these actions
So little justice in life that we get satisfaction from this
 
@ndugger remote? and also high school graduates?
 
No remote, expected to have some experience, so high school graduate is probably a no, unfortunately.
 
5:43 PM
@Alex I did this once
 
5:57 PM
Adios everyone o/
 
See ya
 
 
2 hours later…
7:47 PM
@JBis Wow
 
8:34 PM
 
9:10 PM
love it
 
9:37 PM
v2.0 (now it actually works) of ejs2static npmjs.com/package/ejs2static published
 
9:51 PM
Hello, guys, I am trying to chain files asynchronously using multer, one function to get a single image then the other to get a multiple images but it refuses to work when using them together.
 
@Xcode 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.
 
@Xcode Welcome! Can you post some code so we can see whats going on?
 
@Xcode Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
 
router.post('/', async (req, res) => {
try {
await multipleUpload(req, res);
await coverUpload(req, res);

for(let i=0; i < req.files.length; i++){
console.log(`storage location is ${i} `, req.hostname + req.files.length);
}
return res.send({
"files ": req.files,
"file: ": req.file
});
} catch (error) {
res.status(400).send(error);
}
});
 
router.post('/', async (req, res) => {
    try {
        await multipleUpload(req, res);
        await coverUpload(req, res);

        for (let i = 0; i < req.files.length; i++) {
            console.log(`storage location is ${i} `, req.hostname + req.files.length);
        }
        return res.send({
            "files ": req.files,
            "file: ": req.file
        });
    } catch (error) {
        res.status(400).send(error);
    }
});
just formatted for readability
 
9:55 PM
Alright thanks
import multer from 'multer';
import path from 'path';
import {promisify} from 'util'

const singleStorage = multer.diskStorage({
    filename: (req, file, cb) => {
        console.log(`File: ${file.path}`);
        cb(null, file.fieldname + '-' + Date.now() + path.extname(file.originalname))
    }
});

const multipleStorage = multer.diskStorage({
    filename: (req, file, cb) => {
        cb(null, file.fieldname + '-' + Date.now() + path.extname(file.originalname))
    }
});

//will be using this for uplading
 
ok so what exactly are you trying to do?
 
So I am trying to get a single image to store in multer as well as allow multiple images at the same time to store in multer. I will be connecting it to cloudinary once it works. Though I need to make this work by calling just an endpoint
 
anyone here good w/ D3?

Is there a reason `selectAll('.className').each((d, i) => {...})` would return `null` for `d`, even though the DOM element is definitely there
i know there've been a lot of changes between v3 and v4 for example, but i feel like they're no well documented
 
@Xcode ok and what issue are you having? Are you getting an error or is it simply not working? I haven't used multer but my guess is you don't need two different functions for storing single and multiple images.
 
It simply doesn't work when I combine the two functions
There can't be a way I can't use both together coz they are performing different functions
 
10:20 PM
the reason is that arrow functions don't actually process arguments, and don't have "this"
they inherit it from the environment in which they're defined :l
changed so many unnamed functions to arrow functions because ESLint sayeth
 
@Xcode Hmm. Why not just use req.files with a length of 1 when there is only a single file?
multer seems to do some validation
if you just accept an array of 1 file than you can always use req.files
multer also may mutate the req object to a point where it can't be called again
 
Ya thanks I think I will improve on your suggestion, I get all files by req.files and remove the first image from all other images there, thanks @JBis
 
np, good luck :)
 
02:00 - 14:0014:00 - 23:00

« first day (3413 days earlier)      last day (1518 days later) »