« first day (3196 days earlier)      last day (1745 days later) » 
01:00 - 17:0017:00 - 21:00

1:05 AM
morn
 
hola
 
 
5 hours later…
6:16 AM
@tiagolisalves be sure not only to write a solution, but include at least a brief explanation of why it is done that way
assuming the answer is right, that'll get you rep for sure
 
 
3 hours later…
8:53 AM
Anyone know of a good way to automate pagespeed insights?
 
@BenFortune I was under the impression they have first class CI support?
Ah, not exactly first class it seems
But still, it's an executable you can run on your own
 
Lighthouse has good support for automation, but not pagespeed insights
Insights is their web version
Oh lol
 
9:25 AM
This is the reason why we need laws of any kind on data ownership, any start is a good start
 
lmfao GDPR doesn't stop that in any way
 
It doesn't stop it :P
but it atleast gives you ownership of your data, I see it as a good start 😛 (atleast companies think about wtf they are doing at the very least)
most sane laws don't work in US anyway
(i mean look at their patent laws for eg)
 
Except it doesnt
 
it does
 
The solution isn't and will never be legal.
 
9:27 AM
ofcourse 😃 the solution would be somehow companies not wanting to moneytize
the deterrent though vOv
 
No it doesn't
It just creates accountability
 
It has to be a technical solution, encryption, etc. That's the only way it will work in a world full of malicious actors.
 
And accountability is a decent enough deterrent
 
It's really not
 
@MadaraUchiha you mean anonymization? Encryption when parties share data is well pointless for what we are talking about.
 
9:28 AM
@BenFortune depends if the user has given permission for that kind of use.
 
sec, meeting
 
In a world full of powerful people, I am just a bloke with non-italic white font.
 
Anyhow, another day chrome apis still suck :)
 
@ShrekOverflow another day that ShrekOverflow complaints about it
we know. It is bad. We understand. It is bad. BAAAAAADDDD
 
Imagine a master key, The master key can generate private/'public pairs
When you wish to identify with a service, any service, you generate a private/public pair for that service and hand over the public.
Your public key with facebook is different to the public key with google is different to the public key with the DMV
 
9:37 AM
Fair, what if you lose your key? Who issues these keys? Businesses will never take just the key approach, they'd want some extra stuff too.
 
@ShrekOverflow There are a few reclamation/revocation strategies in general, TBD
 
@MadaraUchiha I do like the idea though 😛 It's kinda what i hope webAuthn would become at some point
but I have adoption conversations 😐 and well stakeholders are not-so-keen on that kinda stuff
 
To be fair, webAuthn is only an authentication strategy
Nobody prevents you from requiring an email address/name/SSN/credit card number/whatever to supply service.
As is my proposal.
That's the gist of the problem.
 
Yep
and

> requiring an email address/name/SSN/credit card number/whatever to supply service.
 
Data is currency, you don't have any ownership whatsoever on your data, laws and all, once you've given it away.
 
9:40 AM
Is the real problem
we talk about it in the book I helped write
"identifier" is a huge pita on its own, but add "data" around identifier and well
 
That's not going away.
 
Oh btw, what do you think of the sign in with apple stuff 😀?
 
We've given up the right to ask for it to go away over a decade ago
 
9:54 AM
let maxAge = Math.max(...personArray.map(p=>p.age));
I get max age in one line, but how can I get the Person object instead of age value?
 
you have used map, which returns a new array with only ages
 
@KarelG I'll keep tweeting that probably forever :P
maybe not in chat though
 
just add a second line and filter your persons array to get only persons with that age only (there can be more than one)
 
but .. I think we don't get enough negativity about chrome
so thought I might share
 
firefox is becoming better than chrome lately
well, imo
 
9:59 AM
But no google sites will work on it so how long can you last on fox?
 
@Jesse personArray.reduce((acc, p) => Math.max(p.age, acc), 0)
 
for work, I use chrome, but I always have been using firefox outside it
 
ah no, that won't work either :)
 
@ShrekOverflow what do you mean with that?
i can read gmail in firefox?
 
esp the firefox part
 
10:00 AM
Could anybody answer this: stackoverflow.com/questions/57071173/…
Not sure why it is not a legitimate question.
 
@ShrekOverflow I love his accent. He's talking in very clear english, even for a hearing impaired person like le me
 
@Neil the result still is the age, not the object
 
@Jesse probably why I wrote "ah no, that won't work either" after that
 
@Neil sorry, I missed
 
you can use reduce tho
personArray.reduce((maxP, p) => (maxP.age > p.age ? maxP : p), {age: Number.NEGATIVE_INFINITY})
 
10:11 AM
Nice!
 
@Jesse ^
but be aware that it only gives the first hit. If there are two persons with same max age, you only get the first one.
Therefore I suggested to use .filter afterwards
 
export function isRequest(queryParams: ParsedQuery) {
    return OAUTH_2_0_REQ_QS_IDENTIFIERS.every(
        param => queryParams.hasOwnProperty(param)
    );
}
it tells me queryParams.hasOwnProperty is not defined at runtime
but not in TS
wtf?
also seems like queryParams is jsut a dict somehow with no proto 😐 hmm
 
eh a literally empty object (without inherited Object prototypes)
 
10:23 AM
yeah wow this is going to be a pain :(
export function isRequest(queryParams: ParsedQuery) {
    return OAUTH_2_0_REQ_QS_IDENTIFIERS.every(
        param => !!queryParams[param]
    );
}
Perhaps?
Although must say I like this more :)
can't complain what if someone was using hasOwnProperty
in QS :)
 
10:36 AM
 
10:47 AM
what is the typescript guide on event emitters?
 
ask @MadaraUchiha , he's more into TS
 
11:39 AM
Hello
 
is there a way to get function arguments in acorn? trying to walk an ast tree, i find my function but i can't get the value sent into the function :thinking:
as an example
 
@AbhishekPandey hey
 
I'm getting data in Angular through http
it's returning me data in following format.

{
	headers: Headers {_headers: Map(5), _normalizedNames: Map(5)},
	ok: true,
	status: 200,
	statusText: "OK",
	type: 2,
	url: "...url...",
	_body: "Array Data..."
}
 
@ShrekOverflow What are you asking?
 
11:45 AM
I get my data in _body key
but array into string so I wrote this piece of code to store data into $scope this.list = JSON.parse(this.list._body);
`this.list = JSON.parse(this.list._body);`

Above line throws error while compiling not, if comment this line, and compile `ng serve` and then uncomment this code
it's working
The error Property '_body' does not exist on type '{}'
 
Are you using Typescript or Flow for typechecking?
 
@AbhishekPandey You're trying to assign a value of one type into a variable with a completely different type, in a strongly typed language, and you're wondering why the compiler complains?
 
Typescript
 
You also didn't type the response format if I understand that error correctly
And if you did, the note by Madara still applies, yeah.
 
@MadaraUchiha hmm, I don't understand typescript much
In JS it must be working
 
11:51 AM
Gorgeous man, this SOMadaraUchiha
 
@AbhishekPandey Not everything that works for JavaScript will work for TypeScript
That's by design. TypeScript is guarding you.
 
@MadaraUchiha that's horrifying me :D
 
Nothing I can do against that type speed :D
We call him Madara "3k words in a minute" Uchiha
 
buh 3k words per minute
 
@geisterfurz007 I actually haven't done a type speed test in a while
 
11:53 AM
why not over nine thousand!
 
Leave the poor tests in peace!
 
AFAIK florian has a very high typing speed
 
@geisterfurz007 I am a fan of him
 
it was around 110 wpm
 
11:54 AM
I heard Afaik florian is blood type b
 
has anyone used .MutationObserver() before?
 
Madara must not be remember, Once I asked him to suggest me that from where should I start learning JavaScript
He suggest me start with basic and some books I guess, but do progress not perfection
 
i am using react hooks and have an onClick={onChange} on an <a>
 
@MadaraUchiha if someone would believe that, then I wouldn't know what to say
 
11:57 AM
I'm bit confident in JS now
 
1 message moved to Trash can
@JzInqXc9Dg Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
const onChange = event => {
    console.log('approvalsForUser event', event);
    setApprovalsForUser(event.target.value);
    console.log('approvalsForUser', approvalsForUser);
  };
 
good
 
but this even.target.value is always null
actually originally tried event.value.target too. dont know which is supposed to be. both null tho
 
@JzInqXc9Dg What's the "value" of an <a>?
 
11:58 AM
<a onClick={onChange}>
              {item.displayName}: {item.count}
            </a>
 
now today he scared me with strongly typed language architecture of TS
 
it is inside a .map from an array
 
ahh, no one is listing my shit, I'm going :D
 
yours onchange (really pick a better name cus it is a click event) is trying to get value from the element that got changed.
you need .textContent
 
@AbhishekPandey Hey, you're the one who's using TypeScript
 
11:59 AM
@MadaraUchiha can I not pass it a specific value thru onChange(value) ?
 
or use data-attributes
 
@JzInqXc9Dg Sure, () => onChange(someValue)
 
@MadaraUchiha :D
 
    $(".rightside").append(textToInsert).bind('DOMNodeInserted DOMSubtreeModified DOMNodeRemoved', function(event) {
        adjust_pages();

    });
 
@MadaraUchiha but after doing that i get this error: Too many re-renders. React limits the number of renders to prevent an infinite loop.
 
12:02 PM
@StephanS $(".rightside") is a collection
 
how would I convert this to .MutationObserver()
 
@JzInqXc9Dg Did you make sure to write () => onChange(someValue) instead of writing onChange(someValue)?
 
Sam
Hey all, should the following callback() function only be called once the fetch has completed? i.e. the data has been sent to the endpoint?
	async sendPayload(data) {
		fetch('http://localhost:81', {
			method: 'POST',
      mode: 'cors',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(data)
		})
		await this.props.callback();
	}
Apologies for that formatting
 
@geisterfurz007 are you talking about the function call in my onClick or the function definition ?
 
12:03 PM
@JzInqXc9Dg <a onCick={() => onChange(someValue)}>content</a>
 
@Sam No. It would immediately call the callback after the fetch is sent.
 
@Sam it gets called directly (fetch is still running)
 
You'd have to await the fetch.
 
use .then or await on the fetch itself
 
Sam
12:03 PM
Ah the await needs to be ahead of the fetch doesn't it
 
yes
 
Sam
Sorry, noob question
I'm still getting my head around async
Yup that works perfect, thanks guys
 
@Sam Ah everyone has to learn and comprehend it. Yours question is okay'ish when you compare it to other questions we often see here
 
@MadaraUchiha Now suggest me how do I solve that red error which says Property '_body' does not exist on type '{}'
 
@MadaraUchiha just for the lolz
 
12:05 PM
that worked @MadaraUchiha thanks. now i just need to pass that value to a sibling component! lol or parent back to the sibling. im not sure yet
 
@StephanS deleted comment's aren't actually deleted.
😀
 
I know but I misunderstood something
 
just say "nvm"?
 
@AbhishekPandey Two steps I think. First: define a type for your response structure. Second: don't assign that list to the response object. Consider it read only for good code :)
 
that's true
 
12:06 PM
Guys, anyway to build complex regex from elementary regexes?
 
@deostroll Not if you like your sanity.
 
Just schlap them together real good and done.
 
what have I done
 
Mood.
 
Doom.
 
12:07 PM
i feel like I opened the flood gate of questions
 
@deostroll the horror! you are almost insane cus you're missing a space there. And you want to achieve that?
are you sure that you need to do that?
@ShrekOverflow about that vid link (chrome monopoly), EU wouldn't allow that. They already fined MS for their oppression
and Google for their advertisement dominance (they favorited their sites over others)
 
lol the EU
 
it something like, I have this regex to match certain characters...I want a regex to match strings which have any-number of such characters towards the string's end...?
too complex?
 
^your-regex-to-match-characters-goes-here.*$
 
12:11 PM
uh, you need to use the kleene operator instead
( + instead of * )
to have > 0 matches
 
for e.g: const whiteSpaceRgx = /([\u000A-\u000D]|\u0009|\u0020|\u0085|\u00A0|\u1680|\u180E| [\u2000-\u200B] | \u2028 | \u2029 | \u202F | \u205F | \u3000 | \uFEFF)/; ... is a regex to match certain characters...
 
What's wrong with \s
 
converting DOMNode to mutationobserver() literally makes no sense stackoverflow.com/questions/35065355/…
 
Anyway; yes you got that regex. No you cannot combine regex object with each other (to my knowledge). You can build the regex in a string however which you can then use in place of such a regex built between two slashes.
 
I want to do something like add that regex with a '+' operator...and suffix a '$'
@geisterfurz007 so I can do a workaround that involves strings, concatenation, and the RegExp constructor...?
 
12:19 PM
I have never used the RegExp constructor. But you should be able to define your whiteSpaceRgx as ([.....F) without the slashes. You can then put those together in a string. Let me make a fiddle real quick.
Took a little longer because I accidentally closed the tab ._.
 
didn't know you could give a string as argument to .match()...thanks...
 
You're welcome ^^ That's what I am used to from Java. I didn't know that there were these regex expressions you could write for quite some time.
 
that's why there exists \s
otherwise you'd go crazy specifying every whitespace char
though admittedly, I don't know with what criteria \s works beyond the ascii table
 
12:39 PM
!!> '👨‍👩‍👧‍👦'.split('‍')
 
@MadaraUchiha ["👨","👩","👧","👦"]
 
That's still one of my favorite tricks :)
 
That is by far one of the most retarded things, I have ever seen. I remember seeing a question about that a while ago.
But I guess some specification somewhere says that that is how it works.
 
@geisterfurz007 Ligatures
(I'm guessing you're replying to me here)
 
Given that I can also define the skin color of an emoji by adding another "emoji" behind it (when placing them in colons)
I am :D
 
12:41 PM
@geisterfurz007 Yup, a skin tone character
That's actually really clever and extensible.
I like it :)
 
!!>"👍🏿".split("")
 
@geisterfurz007 ["\ud83d","\udc4d","\ud83c","\udfff"]
 
Unfair.
!!> '👨‍👩‍👧‍👦'.split('‍').length
 
@geisterfurz007 4
 
I actually cheated a bit :D
 
12:45 PM
See, in my case I would have expected an array of length two containing the thumb and the skin tone character.
 
!!> '👨‍👩‍👧‍👦'.split('')
 
@MadaraUchiha ["\ud83d","\udc68","‍","\ud83d","\udc69","‍","\ud83d","\udc67","‍","\ud83d","\udc66"]
 
What the fuck?
Madara, can you not?
Please?
 
The emoji ligatures are being connected by "zero-width connector" U+200D
 
I hate you.
._____________.
 
12:46 PM
If you examine my first example carefully, you'll notice I'm not splitting by an empty string :D
But here's your case
 
That is exactly why noone like emojis.
 
!!>"👍🏿".split("‍")
 
@MadaraUchiha ["👍🏿"]
 
Where is the skin tone character?
 
Hmm
Yeah, probably a different character for skin tone? :D
No idea
brb meeting
 
12:47 PM
Cya o/
 
Is that done with that &zwj; thing? I have seen a co-worker pulling a similar trick
yup you did
 
1:06 PM
Ah, I see
@geisterfurz007 multibyte is fun
!!> [...'👍🏿']
 
@MadaraUchiha ["👍","🏿"]
 
There we go
 
should that not be reversed?
I thought it was first that square, then the thumb
 
@KarelG No, first the emoji, then stuff gets applied
Apparently, only skin tone is without a connecting character for some reason.
For example
!!> [...'👨🏿‍🦰']
 
@MadaraUchiha ["👨","🏿","‍","🦰"]
 
1:12 PM
That's "man" "dark skin tone" "connector" "red hair"
 
!!> '🧑'+'🏿'
 
@KarelG "🧑🏿"
 
something odd occurs if you use medium modifiier
!!> '🧑'+'🏼'
 
@KarelG "🧑🏼"
 
did not expect that tbh
 
1:13 PM
That you can compose emojis and modifiers like this is pretty neat
 
aye
 
2:05 PM
can you run a var as a function ?
 
sort() changes the order of the original array, right? Is there a function that doesn't touch the original array but returns an array of the same elements in a new, specified order?
 
arr.slice().sort()
 
@StephanS Yeah. var myFunc = function(a, b){blah, blah}
myFunc(var1, var2)
 
i'm trying to use the value of a var in the name of a function
Give me a second i'll write up an example
 
You mean if you have the name of a function as a string?
 
2:13 PM
window[computedName]() might work
 
958
Q: How to execute a JavaScript function when I have its name as a string

KieronI have the name of a function in JavaScript as a string. How do I convert that into a function pointer so I can call it later? Depending on the circumstances, I may need to pass various arguments into the method too. Some of the functions may take the form of namespace.namespace.function(args[....

 
depending on the scope of the function I guess.
 
function scriptrunner(){
var whichscript = (localStorage.Template);
var thatscript = (whichscript + "Switch");
thatscript();
};
 
each part of the namespace would need to be in its own set of brackets
 
i've tried "if" statements but i've learned if and else if statements don't work inside of .bind('DOMNodeInserted DOMSubtreeModified DOMNodeRemoved', function(event) { type of functions
 
2:15 PM
window["my"]["long"]["namespace"]["functionName"](params)
 
@StephanS that makes no sense
 
@rlemon I know
 
no, what you said makes no sense
 
and now you know my problem
 
that isn't your problem.
 
2:25 PM
you're probably right
 
this is what's called an XY problem.. if you somehow think you can't use if/else in a function body, defined like you have, then that's mistaken.
and we should be looking into why you think that's the case.
 
interesting
i'm thinking it's a prolem with .bind('DOMNodeInserted DOMSubtreeModified DOMNodeRemoved', function(event) {
or how I use it
 
it's not
 
the function works when I click on the element
but i'm trying to run functions right after the information is appended onto the page (it looks like this):
    $(".rightside").append(textToInsert).bind('DOMNodeInserted DOMSubtreeModified DOMNodeRemoved', function(loaded) {
        if (localStorage.resumeTemplate == "TopBar"){
          TopBarSwitch();
        } else if (localStorage.resumeTemplate == "SideBar"){
          SideBarSwitch();
        }
        adjust_pages();

    });
 
I take it you're not using a recent version of jQuery
Or are following some super old tutorial
 
2:40 PM
bind is deprecated
 
even then, it doesn't work that way. you've appended the stuff then bound the events.
.bind(...).append(..)
if that wasn't clear from what I just said
and then listen to what everyone else said
 
you just fixed my problem
thank you
what is .bind() replaced by .on()?
 
yes, so next time instead of thinking that you somehow magically broke javascript, investigate the actual problem.
 
it's JQuery, it doesn't need me to break it
 
no it works as designed.
you broke it
well, you didn't use it proper
if statements didn't somehow break
 
2:51 PM
hmm if elses
haskell's guards FTW
 
@rlemon If () { break; }
 
3:12 PM
What does the square bracket mean if I'm reading a documentation of a method? e.g. jwt.verify(token, secretOrPublicKey, [options, callback])
 
usually optional
 
oh that make sense thanks
 
0
Q: Handling client slow network in nodejs (express)

Abhay SehgalWe've a backend in nodejs (express) and in client side we have Android app which allow offline activities also, which can be sync later Now the problem is when user is on slow network make request to server but during the process (db queries) client got disconnected so after process completion c...

 
4:05 PM
 
4:15 PM
is it possible to copy html as formatted text (e.g. something I can paste into gmail and not a string of HTML) using javascript?
 
19
Q: javascript copy rich text contents to clipboard

marvPremise I need help copying rich text to the clipboard using JavaScript. I have searched around and haven't found anything to suit my specific needs. Code function ctrlA1(corp) { with(corp) {} if (document.all) { txt = corp.createTextRange() txt.execCommand("Copy") } els...

 
Hi everyone
 
user8729657
Hello!
 
This is more of a general question, I recently just graduated from a computer science degree and I have the opportunity to pursue a career as a Salesforce developer (Apex) just wondering if it is a good idea?
I am very inexperience so I needed some advice from more experienced devs if that's ok. Sorry for being off topic.
 
4:31 PM
amazing, thanks rlemon! I was unable to find that
I've only heard good things about salesforce (relatively speaking)
every company has their problems, but for their size they seem to be pretty on the progressive side
@Christopher they have enough integrations going that you will have to learn flexibility, which is one of the more important qualities
 
4:51 PM
So you reckon it's safe to apply for an academy that last 2 years to be an apex développer?
 
can I ask something about boostrap?
 
hey lads
export class CompabilityService {

    constructor(
        @Inject(COMPABILITY_PROCESS) private compabilityProcesses: ICompabilityProcess[], ) {
    }

    public async fixCompability(dashboard: Dashboard): Promise<void> {
        for (let process of this.compabilityProcesses) {
            await process.process(dashboard);
        }
    }
}
can you suggest me some better names for my things?
 
@Christopher - I misread... I took that as applying / job offer. I'd be wary of jumping into more education
It's been a while since I was out there looking, but from everything I remember it's about what you've done. Contribute to open source, spawn things, etc.
play with stuff like this: noopschallenge.com and make it public
build something you actually want to use yourself. That always stood out to me on resumes
 
01:00 - 17:0017:00 - 21:00

« first day (3196 days earlier)      last day (1745 days later) »