« first day (3593 days earlier)      last day (1353 days later) » 

1:11 AM
@phenomnomnominal Huge feature request, I wanna ban an artist from my spotify. Like if i have it on "Autoplay similar songs when your music ends" i wanna completely prevent a specific artist from ever being played.
And i use the word "artist" lightly
 
 
2 hours later…
2:59 AM
@JBis That should already be possible from the Artist page
on iOS you go to the little ... menu and hit "Don't play this artist"
 
@phenomnomnominal oh yeah, you're right i just checked iOS. It looks like on macOS instead of "Don't play this artist" I see a "Report" button. Odd.
 
Looks like we don't have it on Web Player or Desktop (my teams)
 
3:19 AM
interesting
 
3:50 AM
Priorities /shrug
 
 
10 hours later…
1:46 PM
"2" + "2" - "2" == 20 XD
 
@vAhy_The 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.
 
2:02 PM
👌
 
Heya folks
I seem to have run into a now that I think about it stupid dead-end :D
I have about 4 services running via Docker, one of them is Traefik I have setup my DNS to point x.domain to 127.0.0.1. This works great when an external service is trying to make a call, but falls on face when I try to make a call internally to a different service using the same domain name. Any suggestions :D ? Or is it normal to just call the internal service directly by its private domain name?
 
3:00 PM
This week's JavaScript Challenge (looking it up is cheating): Create your own String.prototype.replace function that supports async callback functions. It should be a drop in replacement supporting regex (with capture groups) or a string as the first param and an async callback as the second param. You can use String.prototype.replace if you need to, but going without it is more creative. Respond back to this message with your answer.
4
 
async for a string replace, huh?
regex is heavy...
 
3:21 PM
@canon yes, see the mdn doc for more info
 
4:17 PM
@JBis mdn's just going to give the same old info for the synchronous method that's been around for decades, isn't it? Am I missing something?
 
yes
 
ah, you want the callback to be async for the replacer
derp
 
yes
 
gotcha
that reading comprehension, though
 
Hi all, I'm new here and i want to learn how to contribute in open source community.
Can someone guide me as I don't have any idea right now how I can use my extra time in a productive manner on open source community.
 
4:22 PM
@SaadAwan 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.
 
@SaadAwan find a project on github, click the issues button, start fixing em
 
@SaadAwan most projects have their terms of conduct / how to contribute usually in the project folder look around for this and if you cant find it just write clean code and make a PR. am sure your contributions will be welcomed
 
4:53 PM
@JBis wouldn't that enforce .replace to in-turn also be async?
I'd suggest using replaceAsync instead then
 
5:21 PM
@ShrekOverflow yes, your function would be async
@ShrekOverflow well whats the implementation of that function
 
5:33 PM
Why would any function accept an async callback?
sounds like an anti-pattern to me
map being one of few exceptions
 
5:51 PM
@KevinB replace is kind-of-a-map
but I agree, it can be really misleading if not careful
 
@KevinB I'd argue that forEach can also accept async function. But I wouldn't argue that very vehemently, I think at that point you probably want a loop. As for .map() I wouldn't even call it an exception, since it doesn't really apply in that case. Fundamentally, it's mapping to a promise, the fact that it's an async callback is basically irrelevant to the result. You can also .map(x => new Promise(res => res(doStuff(x)))) and you'd get the same result.
 
i mean
 
At any rate, regarding the challenge - so the expectation is to have str.replace() but now it returns a promise, correct? And it should support the old API + receiving an async callback?
 
it can accept it, but it being async has no purpose
 
@KevinB it = .forEach()?
 
5:55 PM
yes
 
The only reason to use an async callback is to use await. But again, at that point you're probably better off using a loop. Or .map() + Promise.all()
 
At best, it lets you write await within it, but it leaves you with a bunch of promises you can't wait on.
making .replace both handle the old syntax AND accept an async callback would fall into the same trap
unless it on purpose returns two different return types (promise or a new string) which... is awful
 
It makes a bit of sense if you have a terminal operation on a bunch of data and you want each to be processed in certain way. e.g., await save(); await notify(); or something. But you're sort of screwed if you want to build in any way on top of that, which is why any other method is better than this.
 
Better route would be to just make a replaceAsync
with the assumption that it always returns a promise
it wouldn't need to accept a string in place of a function
 
6:35 PM
Trying to do something about the challenge but I just realised something that made it quite annoying. The replacement can change the length of the string. E.g., "hello world".replace(/l/g, "LL") results in a longer string. And it gets longer with every replacement. My idea was to just leverage .replace but wrap the function argument into something that does a manual replacement - find the offset and where it ends and then slice the string around put the replacement in.
But that is not going to work as I hoped if the replacement is not the exact same length as the portion being replaced.
groan
 
7:08 PM
@KevinB Yes. It's replaceAsync. You don't need to support sync callbacks for your function. Just async.
I don't see it as an antipattern.
If you are passing an async function as a true callback (like where you handle the result of the function) then it's an anti pattern. But if you are passing a function as an argument (stilled called a "callback") then i dont see an issue.
 
@JBis I have lost my vocabulary and am definetely not eloquent enough as the others here
 
sup shrek
 
but I am pretty sure string replacement etc shouldn't be encapsulated or abstracted by asyncyness
 
why not?
 
do you have a use-case for replaceAsync :)
@forresthopkinsa o/ I am back! (and I am coding these days, perhaps I'll get my flow back lol)
 
7:32 PM
Hey! Good to see you around (:
 
7:54 PM
Hello can someone help me with this: jsfiddle.net/yqnmc4gv I'm trying to word break on the title but it doesn't work and i cna't figure out why
i found why my bad ggs thx for the help
 
8:49 PM
@ShrekOverflow yeah, i've seen it
 
9:09 PM
@JBis can you share it?
I can't think of a general enough use-case for it
 
Anyone know how to import Lato-Black into the font-family Lato for the weight of bolder?
@font-face {
font-family: "Lato";
src: url('../fonts/Lato-Black.ttf');
font-weight:bolder;
}
 
@JustinHarris 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.
 
Makes my font flash bold when loading
 
@ShrekOverflow iirc replacing an id with a username from a database in a string
This is one of the most insane things i have ever seen in my life
like what the actual fuck
 
9:28 PM
the game is really nice
 
no js tho
 
9:44 PM
I like the attitude of this game :D
 
huh... so... fun fact
in coldfusion... ArrayFindNoCase also ignores leading zeros.... ????
tf
 
Someday ImageMagick will finally break for good and we'll have a long period of scrambling as we try to reassemble civilization from the rubble.
5
 
plain old ArrayFind doesn't ignore them
probably some type coercion going on
 
10:17 PM
@Feeds This...hits painfully close to what I've experienced. I am (sort of part time) maintaining a system written using Vaadin - a Java web framework. It's awful but beyond that, the system uses Vaadin 7. In case you're wondering, the current version of Vaadin is 14. Well, they sort of skipped a few versions around 10 but whatever. It's old.
When I google some issue with Vaadin I feel like I keep bumping into solutions from about 5-7 people.
 
10:31 PM
@Feeds the caption is perfect
 
padleft?
 
lol right
 
I cant think of any other though...
 
padleft is a lot closer to the top of that stack
and it never needed to exist anyway
the caption says imagemagick which is spot-on
 
hello
 
10:34 PM
I suppose I should google ImageMagick
 
10:47 PM
lmao
 
11:28 PM
@Wietlol It's a command line application for image manipulation. You can leverage it to script a lot of operations with images, like rotations for example. Probably more relevant is cropping and resizing which is done for, say, avatars. IIRC most of the common forum software that was running on PHP used ImageMagick for almost all image handling (avatars, signatures, image uploads). Some image sharing websites also used it but I imagine they've moved on.
Stuff like online shops in PHP (and maybe Wordpress?) will use it to make uploaded product images presentable for the web. I know PHP uses it a lot (because making a call to the OS is an easy hack) but I suspect there are more software out there that relies on it that I'm not aware of
 
and it is maintained by a random person somewhere in the world?
 
Pretty much anything running on backend that does image manipulation is almost certain to be using imagemagick
as far as being really obscure though, you'll find better examples on the layer below imagemagick
 
perhpas I will meet ImageMagick when I do image manipulation... some day... :D
thanks for the info VLAZ and forresthopkinsa
 
heck yeah
 

« first day (3593 days earlier)      last day (1353 days later) »