« first day (3153 days earlier)      last day (1812 days later) » 

12:01 AM
@StephanS What site?
 
12:25 AM
@JBis " Apple's site for macOS Sierra. They did some incredible 3D things without 3D. it was weird"
 
12:42 AM
@StephanS Oh. Its not there anymore. But most of Apples pages have very good design. The Sierra one just stood out.
Maybe I can get an archive site one sec.
 
 
2 hours later…
2:35 AM
ok so I'm assigning a property in a class definition to an array function chain
so arr = [...].flatmap(...)
now the thing is that I'm also trying to pop off the last item, but I can't put the pop() in the assignment, because then it returns the item that was popped
and I can't put arr.pop() on the next line because it's a class property assignment
I'm just trying to find an elegant way of doing this
 
@forresthopkinsa .filter((_, index, arr) => index < (arr.length-1))?
 
not particularly elegant but I'm not seeing another way
thanks
 
> When you're tired, write a function to parse numbers, then find out a handy function called parseNumberOrUndefined, just what you need, so you delete the whole thing, try to use it and it also vanishes from existence. Later you realize that you're just plain stupid...
Sounds like something I would do...
 
2:51 AM
sounds fake
 
@forresthopkinsa .slice(0,-1) would work too
 
now that's more like it, good work
 
4:03 AM
@forresthopkinsa yeah, use slice, filter is mega-ew for that problem lol
 
 
2 hours later…
6:05 AM
Hi Everyone
 
6:19 AM
good morning
 
6:36 AM
hi good morning guys
 
@SanjayaSenevirathne 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.
 
6:47 AM
console.log(life === cake.slice()); // life is a piece of cake
 
@Neil nah. you don't have life because it is not defined.
 
7:07 AM
am sad now ._.
 
7:26 AM
I have "little eyes" today
so visible that everyone were saying "got a tough/long night?"
 
@KarelG What's "little eyes"?
 
Little eyes, little sweet little eyes
You can't disguise, no you can't disguise..
 
@MadaraUchiha when people have slept not enough or not even went to bed, they appear less vital, less focused. You can see that mostly at their eyes, the eye lids are not completely open. Hence "little eyes"
 
@KarelG Oh, you mean like the state I'm constantly in
Gotcha
 
the right one is after having not sufficient sleep (sleep deprivation)
 
8:02 AM
Catalina ships zsh as the default login shell
 
8:18 AM
idk what zsh is
 
8:39 AM
fish all the way
although this is good 😛 zsh default is great!
Hopefully others will follow Apple (like they usually do on common sense things)
 
I have experienced telnet logins
so anything else for logins are probably better
 
8:58 AM
Hi guyz, i am trying to run angular 7 app with angular universal. But in one of the page i need to check the host name of the current url, so i did something like this const currentHost = new URL(current).host; but when i complie on the server it gives an error on the server console that URL is not defined.
Can anyone please help me?
 
@user7747472 you have to use Location when being in angular context.
 
9:45 AM
@KarelG hey i wrote openidconnect for ssh
you can just use that now :P
$ ssh foo@<hostname>

Login using auth.goph.me.... full url redacted .... or goto auth.goph.me/activate and enter code <redacted>

<boom>
Looks like ^
If you have a session you don't even need to login again
 
10:23 AM
no wai.
and when exiting, does it remove your token?
 
@KarelG yep
I am talking about this demo in Angular NYC on June 18th [with a live demo!!!]
it can even do on the fly provisioning but I will need some tweaking for tis to work
 
how about shared users with limited access?
 
@KarelG with auth0 you can do that too
it looks at a claim in the JWT it receives :)
that it uses to decided which user this is going to be 😛
 
10:38 AM
Hey guys
Long time I haven't been to Vue
 
Ideally though @KarelG they should be a group and not users :P
 
Do you how to compose a class or an attribute with data ?
Something which would look like this if strign literal was working
:id=`delivery-type-quick-${index}`
Okay it appears I was just missing " "
:kappa:
 
@ShrekOverflow member of groups you mean?
something from the past. :P
 
@KarelG yes
 
had to purge a set of keys on a server once because I could not verify whose keys those were. 🤔
 
10:43 AM
the module is configurable so you can do whatever you want :P
[itsjust python]
@KarelG yeah in this approach there are no keys
 
then a whole dev department panicked
 
unless you want to allow that
ain't that good eh?
 
cus they could not connect with that server
 
sso into friken ssh!
 
I was like "oh it is from you all?"
(sys admin was mad on me)
 
10:44 AM
May I have the permission to use this story for my talk?
lol
 
sure
now each key gets a name associated with it.
 
The part I like about it is the fact that we now have a standard way that works everywhere
 
Hello
 
olleH
 
Hello
 
11:07 AM
how are yall doing
havent been here in a while
 
11:26 AM
Not sure if anyone else has experienced this, but I've been facing this issue for a while
Sometimes Angular Material applies styles such as expected, and sometimes it just ... does not. Seems to happen randomly? Can't seem to reproduce it consistently either, it just .. happens.
Anyone has an idea what this could be? I'm thinking it's defo not wrong imports and such because sometimes it does apply correctly
 
 
2 hours later…
1:10 PM
Hello
 
@AmirhoseinRajabi 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.
 
i want to call an external API in expressjs whichis using HTTP State Management (RFC 6265)? and the cookie provided by that API is required to call other API's
 
yes...?
 
how should I call it and store that cookie in expressjs? I try axios but nothing happened
 
@AmirhoseinRajabi expressjs has nothing to do with it
What have you tried?
 
1:29 PM
@MadaraUchiha I tried to store the cookie value provided in the external API using nodecache package and pass it manually to other external API's but it didn't work
 
2:07 PM
formatNumber: function (val, c, d, t) {
        var d = ".", t = ",";
        var n = val,
            c = isNaN(c = Math.abs(c)) ? 2 : c,
            d = d == undefined ? "." : d,
            t = t == undefined ? "," : t,
            s = n < 0 ? "-" : "",
            i = String(parseInt(n = Math.abs(Number(n) || 0).toFixed(c))),
            j = (j = i.length) > 3 ? j % 3 : 0;
        return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
do people really write code like this?
who would do this
 
@misha130 No
That looks like minified code that underwent the browser's "pretty print" function
 
it aint
I mean I took it from a code base that is not minified at all
oh man thats hilarious
 
@misha130 Then it got to that codebase after someone copy/pasted a piece of minified code, and ran the editor's "format code" function on it
 
look there is a variable called "val"
so if val is not minified I am pretty sure none of it was
 
2:10 PM
so the person added the val but copy pasted the minified code
 
@misha130 Yes, because val used to be this
And they wanted to turn it into a "static" function.
i.e. not on Number.prototype.
Here's another version of the same code stackoverflow.com/q/40426965/871050
 
Are there any ways to give addition assignment(+=) with translate property in JS?
 
@sniffingdoggo 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.
 
I've tried this ways
`this.myFrame.css({transform: 'translate(+= 4%, 0)`})`
`this.myFrame.css({transform: 'translate(''+=' + '4' + '%', 0')'})`
`this.myFrame.css({transform: '+=' + 'translateX(4%)'})`
`this.myFrame.css({transform: '+=translateX(4%)'})`

but none of those work
Any kinds of help is appreciated :-)s
 
posted on June 04, 2019 by Michaël Zasso

Notable changes doc: The JSON variant of the API documentation is no longer experimental (Rich Trott) #27842. esm: JSON module support is always enabled under --experimental-modules. The --experimental-json-modules flag has been removed (Myles Borins) #27752. http,http2: A new flag has been added for overriding the default HTTP server socket timeout (which is two minutes). Pass --http-serv

 
2:13 PM
@misha130 stackoverflow.com/a/149099/871050 this is the original source.
Someone actually wrote it like that.
 
Thats great
 
Don't write like that.
Unless you want to be fired.
 
I wish the person who wrote it was fired but he is a freelancer
so yea
 
@misha130 He didn't write it
 
copypasted it*
 
2:14 PM
He clearly copy/pasted it and modified it a bit
 
2:25 PM
@ShrekOverflow @misha130 said it's a he.
 
fixed
 
2:58 PM
What is the difference between string.split(" ") and string.split(/\s/) ?
 
@HappyHands31 \s matches more than just ' '
But practically, nil.
 
@Madara What else does \s match? \s is whitespace, right?
 
@HappyHands31 space, tab, newline
 
@Madara Interesting, okay thanks.
 
3:17 PM
o/
 
wish i had my own work PC back
 
no magic hebrew hacker glyphs in chat
 
3:35 PM
🚽
 
@ndugger why does it matter?
 
@earlyriser01 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.
 
@ndugger just read the rules and there's no rule that says a user cannot put hebrew letters in here. Besides, @MadaraUchiha only put final mem - which is a Hebrew letter used at the end of the word.
So in reality, it's not a "magic" hebrew "hacker glyph"
 
?
 
Hebrew letters can cause formatting trouble on some systems since they are written , so I can see how they might be discouraged generally. They write in Hebrew all the time over on Mi Yodeya (and things don't seem to be falling apart there), so I would expect most of the issues to be solved, though.
 
3:52 PM
I'm using the second answer from this question https://stackoverflow.com/questions/30906807/word-frequency-in-javascript
on getting the frequency of each word in a sentence.
function wordFreq(string) {
    var words = string.replace(/[.]/g, '').split(/\s/);
    var freqMap = {};
    words.forEach(function(w) {
        if (!freqMap[w]) {
            freqMap[w] = 0;
        }
        freqMap[w] += 1;
    });

    return freqMap;
}
I'm confused about what the (!freqMap[w]) { freqMap[w] = 0;} is doing
If it's not a freqMap {} value, it's value = 0?
I understand that otherwise, it's adding the count to the value?
Maybe I need a better understanding of hashes in order to get this?
 
if freqMap[w] is falsey, set it to 0
 
So in this string
 
in other words, if it doesn't exist, set it to 0
 
console.log(wordFreq("The rain in Spain falls mainly on the plain."));
 
its like saying count = 0
 
3:57 PM
What word would be falsey?
 
the words aren't what it is checking
 
@KevinB Oh, what's it checking then?
 
i don't think that code works
oh, wait yea
 
It did work for me, yeah
 
it creates an object with a key for each word and a number as its value
 
3:59 PM
so what it's doing is it's seeing if he object has a property named the word
 
and how many time it appears
 
if it doesn't, it creates one and sets it to 0
then incremented to 1, then each additional time it is found, it's incremented.
 
Ah okay, interesting.
I still don't fully understand - when I do a console.log(freqMap[w]) within the .forEach loop it logs undefined.
I would just like to be able to see the object as it's being created to help clarify.
 
Ok, so, you start off with {}
 
do it after the if
 
4:08 PM
on first iteration, it looks for "The"
the if statement won't find "The" in the object, so the object becomes {"The":0}
on the line after the if statement, it is incremented, so {"The":1}
rinse repeat
 
@KevinB Thanks.
I see, because the freqMap is initialized as a blank object {};
 
havascript
 
I'm using promise.all to essentially make 2 https.request, in mocha i've set up nock to intercept, however i'm not sure i have it setup correctly. I'd like it to intercept all requests to the url, not just those that match a specific body
 
5:10 PM
Question: Is the rule of thumb in web dev to host your clients sites or should you set the client up with their own hosting service?
Im thinking the former due to the fact of you being in control of the service and since they have no idea what hosting is?
 
depends on the client
When i did freelancing/contract work, i preferred the client have their own server, and when they didn't, i set one up for them and gave them the keys. My reasoning was I didn't want them reliant on me for getting their shtuff updated/modified etc, because freelancing was just a hobby.
now i don't do it at all
 
5:28 PM
How do you do it then? @KevinB

How did you set them up with their own server/what hosting service did they use?
 
it's been years, but when i did, i just gave them a godaddy shared host
 
interesstttinnnnggg. Im building my mom a site and figuring out how I could go out and apply all that im learning for other clients
 
If it's just a static site that doesn't require a back-end, then using Amazons S3 is also a good option. I used it to host a static site I made a little while ago. docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
 
@Fearnbuster 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.
 
i was thinking of using digital ocean? the only thing im trying to get around is when they request payment. How would I approach someone about that? because i dont want to be responsible for paying each month. I know i could bill them, but i dont think thats as effective
 
5:33 PM
yeah, now days i'd turn to AWS rather than godaddy
only downside is godaddy has more approachable support
 
digital ocean isn't bad
 
isnt aws kind of expensive?
for their elastic beanstalks atleast
 
Yea, that is rather expensive, but S3 is really cheap.
Depending on what you use it for
 
both AWS and GCP have "micro" instances that are dirt cheap
 
My goal is just to offer my services to ma and pa type of clients. I just need enough to pay the bills which isn't a lot. It beats packing away peanut butter at a grocery store QQ
I know hostgator is viable, but i also want to build my own sites from scratch. So its between google vps, AWS or digital ocean
 
5:40 PM
no don't use hostgator or godaddy
I hope by "google vps" you mean GCP
in which case, yes, use that
 
why should i not use either godaddy or hostgator?
 
they don't give you much control over the server instance
not very flexible
 
ohhhh yeah. I should probably want root access?
 
check out GCP free tier
you want to be able to spin up your own containers
 
I know nothing about back end shizzle. Is that required if most sites will be built using wordpress CMS? I know wordpress uses PHP for there backend stuff.
 
5:44 PM
these are static wordpress sites? that changes things a bit
I'd expected different since you are, after all, in the javascript room
 
ehhh i mean, i want to offer my services to as many people as possible so no, not just static lol
 
there's a world of difference between a static site and a web app, I'm sure you know
what exactly are you planning on providing?
 
Essentially anything requested by the client. Right now, im building a blog site for my mom. Shes being hosted by godaddy, but i wanna move the hosting to something different. Most sites that ill build for clients will be with a CMS to make things quick and efficient
 
if you're just doing CMS sites like WP, and you're not interested in learning about back-end stuff, then you can just go with GD/HG/etc; that's the market segment that they're for
I don't think you'll find very many people who are gonna pay you to make them a blog though
 
ohhh interesting. Okay. I know a lot of people are capable on building their own blog. Im just doing this blog site to give a rough time estimate on how long it will take me to build a site using a CMS
 
5:51 PM
Sure
I'm pretty sure GoDaddy et al. will charge you hosting fees per domain, whereas a more complicated solution would charge you per instance, and you can host multiple sites on that instance
So I think if it were me I'd still do a GCP container despite your simple needs
 
Where can i read more about that?
 
link I sent earlier
13 mins ago, by forresthopkinsa
check out GCP free tier
I'd say either GCP or DigitalOcean
^ one click WP deploy
!!afk lunch
 
Oh wow, gcp does definitely look nice. Thanks for differentiating GD/HG from AWS and GCP. Ill prob be doing gcp X)
 
6:13 PM
hi, what is the advised datatable for crud operations with database and reactjs, is it better to just craft your own or use something like react tables etc
 
6:24 PM
any shortcut in typecript to combine all enum values in to All
enum Something { First = 1 << 0, Second = 1 << 1, All = First | Second }
but without writing all the possible values...
All = Object.keys(Something).
        filter(key => !isNaN(Number(Something[key]))).reduce((sum, current) => sum | Something[current], 0)
haha no this is so terrible
 
7:17 PM
@forresthopkinsa why not just run on a normal instance? Is there an benefit besides ease of setup to using this?
 
@JBis forresthopkinsa is afk: lunch
 
forresthopkinsa will see it later cap
 
does anyone have common knowledge with react?
 
7:52 PM
I have uncommon knowledge with react
@ShrekOverflow we use an API Gateway. We use OAuth2 for all authentication.
 
Usually when I'm using a regex I do something like:
let string = "helloWorld";
console.log(string.replace(/[h]/g, "j"));
and the g in /[h]/g means "global", as far as I understand
but what does the i mean when you see: /[h]/gi
 
insensitive
for case insensitivity
 
Oh okay, thanks.
 
actually, it technically stands for "ignore", for "ignore case"
but I like mine better
 
@ndugger sweet thanks!
 
7:58 PM
np broseph
@earlyriser01 I was being facetious, lol. I know Madara well enough to make a stupid joke.
 
8:24 PM
@JBis No, it's just a shortcut, but faceless does not seem to have any experience with server/container setup
@DavidKamer definitely
 
9:13 PM
@forresthopkinsa Ah. Thanks.
 
@ndugger I'm Jewish so I find it offensive.
 
 
2 hours later…
@JBis lol @ everyone in the discussion groaning about the new CoC
 
yep
Just scrolling through the PR page is really funny. So many people are obviously just trying to be able write "I help create linux" on their resume.
 
user8729657
Yea linux is pretty awesome
 
@forresthopkinsa haha
 
user8729657
11:58 PM
I'm waiting for Centos 8
 
user8729657
:)
 
 

« first day (3153 days earlier)      last day (1812 days later) »