« first day (3807 days earlier)      last day (1365 days later) » 
01:00 - 15:0015:00 - 21:00

01:25
morning cOOders
02:13
just did something useful in go....with no dependencies
woah
 
5 hours later…
07:15
@JBis you know what? I was going to give you a really bad pun "Go independent" but googled it just in case it was a thing. Well, apparently it is. Something about making better food for the elderly. There is also a French thing that I have no idea what it's about. They have a website...in French. According to the the very short video, it's somehow related to a barista, moving boxes and driving a Porsche. No clue.
Since I couldn't really figure out a good joke out of this, I'm just inflicting this knowledge upon you.
 
1 hour later…
08:44
Hi All,
recently i have done some regex to validate all types of youtube video URLs, like as far as i explored i could see three types of URLs
1. Shared URL
2. Embedded URL
3. Original Video URL
similarly i'm trying to do the same for facebook, but i have not found any source which shows the types of feeds / posts and patterns of facebook shared posts
 
1 hour later…
10:11
43
Q: Regex for youtube URL

JenzI am using the following regex for validating youtube video share url's. var valid = /^(http\:\/\/)?(youtube\.com|youtu\.be)+$/; alert(valid.test(url)); return false; I want the regex to support the following URL formats: http://youtu.be/cCnrX1w5luM http://youtube/cCnrX1w5luM www.youtube....

10:34
Trying to find a porper angular material icon from angularjswiki.com/de/angular/… for I/O (analog input/output) control. So far I only found <mat-icon>swap_horiz</mat-icon> suitable. Any suggestions other than generating a svg myself?
10:57
in react, can we easily dump the state at runtime (for example, when an error occurs) and spin up the website on the dev environment and load the state from the dump?
iirc, there was something easy for that
but I cant find it any more
11:08
Man I miss seeing good old javascript questions here..
Atleast I could somewhat help people then. Now its all react and angular and three and stuff, and Im totally baffled
Maybe I should learn react
It looks interesting
Someone can help me to setup a vue 3 project with Slim 4 php?
@newbiedev 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.
Since it use a front controller pattern, the index.php will load all the routes. I'm not sure on how to load the vuejs app
12:02
@Wietlol Never heard of that explicitly for reactjs, only sentry reprocessing which looks more or less like the typical stackdump symbolication and Chromes/Firefox HAR export and import.
While HAR is more or less a complete snapshot, I don't think you can simply use it as a state to load and execute in dev server.
12:19
@Wietlol You can hydrate the state, but you'd have to have it saved somewhere
well... the state would be sent to our logging/ticketing system
as long as I can just load the state somehow and get exactly the same view in front of me as the user had at the time of the bug report, then I am happy
I would assume React has something really nice for this, considering it is purely state based
Is it pure react? Redux has a function that dumps the state
@VLAZ thanks for the info :)
100
Q: While debugging, can I have access to the Redux store from the browser console?

André PenaI have unit tests for my reducers. However, when I'm debugging in the browser, I want to check if my actions have been called correctly and whether the state has been modified accordingly. I'm looking for something like: window._redux.store ... in the browser so I can type that on the console...

tech stack not yet determined
so, if redux has it, then redux might be what I am looking for
12:26
@Wietlol react + redux-saga is quite convenient ;)
@Wietlol AFAIK, you can save workflows in Redux and recreate everything that lead to a issue. I've only seen a demo of this and looked neat. I've never really done much with React, though.
i swear by redux-sagas
granted, i've never used other state management libraries so i'm very biased
Im severely pissed off...
I made a fancy calculator (Inspired by my class assignment yesterday) and I added support for exponential calculation.
But apparently if you add a <sup> element in a div, it places the exponent under the number (Like it doesnt fit in the box, even when I give it lots of space)
Like wtf
and now Im considering using canvas because of this crap... (I can have a lot more control over pixel-perfect design and number placement)
@MisterSirCode mcve?
may need to adjust line height
@JBis +1. Probably something weird happens with boundaries and sizes
12:33
https://replit.com/@skylerspark/Quicalc#script.js
You can take a look at it if you want
Its not my greatest work, but its pretty nice. I tried to keep the code concise and clean
@VLAZ The problem is, when I want to resize a box, I have to reset all of the grid settings, re-align everything, change font sizes... its just a mess
I wanted to experiment with CSS Grid since everyone talks about it like its the holy grail
but so far the experience isnt fun
> The mental model is that a saga is like a separate thread in your application that's solely responsible for side effects.
sounds interesting... I need to check this out
Have you considered using absolute positioning with just hardcoded offsets in pixels?
I've seen professional software use that.
(the one I have to support...)
I guess? I just wanted to make something dynamic
Im probably going to need to rework the box bounds and font settings anyways, because currently if you create a very large number (not infinity) itll go out of bounds
other than that, it works beautifully
all the buttons and numbers look great...
but large numbers and exponents? BLEGH
Works great*!
* as long as you don't change the window size much**
12:37
** actually, it's not that great even then***
*** it's a PIA to change anything. ****
**** it's crap
Ok ok
Dont gotta be so blunt
it works, except when it doesnt
It was meant to be self-deprecating
Hmm, is it just the design? or...

Because I set it to use viewport height, so atleast the fonts and shadows / effects scale with the calculator itself
(Im using VH because this is meant to go into an extension window, and VH / VW are almost always used)
it's definitely the design ;)
12:39
just... dont scale
you'd be surprised to see how many applications embrace that statement
most applications just have a set of ratios and sizes which would fall in different categories
unscaled components would consume remaining available space
Suggestions:
- Don't omit brackets, not even in single line statements.
- Don't call a `update` function in the middle of your function declarations
- Don't use template strings if all you're gonna do is insert a variable into an empty template string (\`${curCalc}\`)
- Add some whitespace in your code. (Linebreaks after if statements, for example)
well, excusing my shit quick-design skills, got any suggestions for fixing my scaling issue with large numbers and exponents
The numeric keyboard layout is also rather unconventional :D
12:44
i hate repl
lol
@JBis Its my only choice on a school proxy
Oooooh, that's a exponent button
doesn't js fiddle work?
or jsbin
trust me, once I get home, I trash repl like its the scum on the bottom of the bin, and go back to using VSCode + Live Server + Github
JSFiddle doesnt have autocomplete for html .-.
and thats a dealbreaker
I hate writing html tags manually unless I need to
12:45
Your button hover shadows are overlapping on neigbouring elements
@Cerbrus Thats a purposeful design, I was just experimenting with shadows with this app
@MisterSirCode: jsbin.com > type in div, then press [tab]
@Cerbrus It does nothing.
facepalm
It doesnt have Emit Completion
12:46
you wrapper is flex
you've told it to put it on a difference line
Nothing? Pressing tab turns div into <div></div>
And div.row*8>div.col*2 into....
<div class="row">
  <div class="col"></div>
  <div class="col"></div>
</div>
<div class="row">
  <div class="col"></div>
  <div class="col"></div>
</div>
<div class="row">
  <div class="col"></div>
  <div class="col"></div>
</div>
<div class="row">
  <div class="col"></div>
  <div class="col"></div>
</div>
<div class="row">
  <div class="col"></div>
  <div class="col"></div>
</div>
<div class="row">
  <div class="col"></div>
  <div class="col"></div>
</div>
<div class="row">
  <div class="col"></div>
I forgot what that syntax / feature is called, but it's friggin beautiful
also your css selectors are way too specific
@Cerbrus Codepen, Repl, and every other online WYSIWYG does that, they have Emit automation, but for some reason, jsfiddle doesnt
I didn't link to jsfiddle, now did I?
Oh yea, the CSS selectors could do with some cleanup
@MisterSirCode: replace all instances of div.className with just .className in your css
12:51
also remove this crap
const $ = e => document.querySelector(e);
lol I just wanted help with some exponents and yall are minimodding the whole thing
This is just an experiment
When I gave that, it was to make a point not use in practice
No, we're trying to give you advice based on industry experience
@MisterSirCode that is standard SO practice
While it may sound like nitpicking now, these are good practices that you'll profit from, later on
12:53
^
I mean, the annoyance I have to deal with on a daily basis because bootstrap is setup with over-specific css selectors...
i've never used a css library, i just do things custom
It's a legacy thing at my current (soon to be former) employer that snuck into the CMS they decided to make
ah
The funny thin is, I got a call from a colleague just now, saying he's also leaving the company for the same new employer I'll be going to xD
12:56
lol
why y'all leaving? better pay?
Better pay, more input...
nice
That CMS is a friggin mess... Developer ideas are shot down, because it has to be simple for the customer
So we don't get to spend a day to build a tool so we can import / export configurations
Does the customer want to change their page templates? There's no tool for that. A Dev either has to get into the DB or write an SQL script to add a new template...
Don't cause me pain.
And it's a majestic mess of angular and ASP.net form posts, just because the lead dev wasn't comfortable with us building a full-blown angular app
13:00
Literally had yet another discussion about something like this today.
So here I am now, finishing off the last project... Imma insert a tiny easter egg into it
We built a workflow engine to help out with an application. The idea was to make it, then add more bells and whistles. Well, no more bells and whistles.
Heh so you got a somewhat functioning skeleton?
We need to go and generate XML by hand (well, using other tools, at least) and then add them to a database. Make sure identifiers match. Update related tables. Etc.
Every time we need to change a workflow we ask for time to make a tool that will help with this. We're told we don't have the time.
Time is an investment
13:02
Yes, so now the task that is "update workflow schemas" is estimated at 20 hours.
@Wietlol @BenFortune we are talking about different things: "as long as I can just load the state somehow and get exactly the same view in front of me as the user had at the time of the bug report" only works with a snapshot which replicates the internal state of ReactJS as well as other states and other components (not to mention the DOM), redux hydration (like f.e. using redux-persist) just takes a snapshot of the store
As opposed to, say, 1-2
I know the pain
We have widgets in that CMS: Media, buttons, text, social, etc...
These can be configured to have different "styles"
We saw a glimpse of hope because the system might be re-written in Vue.js. If so, we'd just remove the workflow because it's honestly easier that way.
If we have to copy the configuration to a new environment... we have to do that by hand
While that config is literally available in a JS variable that could be imported / exported as JSON
2 hours dev work to make that work
In fact, I built the tool during some useless meeting...
Not like it's gonna get implemented tho
13:09
> The Diffusion Intelligent Event-Data Platform enables organizations to accelerate innovation and deliver game-changing, real-time applications to market faster, while significantly reducing the cost of software development and operations.
wat.
Marketing overflow.
"to market faster"
Oh, I didn't parse that sentence correct. It's "bring ... application to marker faster"
Weird garden path sentence.
Sounds like advertising talk for "We have a tool to quickly build generic applications, but if you want something custom, we'll make promises we can't deliver on"
So, we've had this big client in the past, website with literally millions of visitors, and a very successful app...
They decided they want the website and app in their own control
And went for some "low code" solution, which was never gonna work.
One year later, and the app is still crap, getting 1-2 star reviews after consistently scoring 4-5 over 10k reviews when we made it
But at least they are in control of it all :D
That's all it matters
Had a customer who had a site for their B&B. One day they call us and ask us to remove their phone from the site. The reason was that they just get too many calls.
Hah
So how are people gonna book then? xD
13:20
I think the email form was left.
But customers usually just called.
We did it but we asked repeatedly and carefully if that's what they wanted. The answer was a very absolute "Yes".
Yea I usually prefer calling over email
Still one of the strangest requests I've been involved in.
I've had this one site come to us repeatedly with issues with their ads...
When it's their advertising provider that kept changing shit
13:48
hey, how are those two functions not the same ?
when i call this $('#table_test').bootstrapTable('refresh'); it works
but if I used Javascript vanilla
`let b = document.querySelector('#table_test');`

`b.bootstrapTable('refresh');` it doesn't work
Uncaught TypeError: b.bootstrapTable is not a function
yeah ...
bootstrap hooks up their functions on jquery
each jquery object is a wrapper around your html element
first function = jquery object that is a wrapper around id="table_test" element
second function = just id="table_test" element
oh I see
but I there is a way around this to use vanilla instead of Jquery?
see that bootstrap as adding a lint on a jquery wrapper
@LoopingDev not really
so what you have here is basically a nicely wrapped package with a lint around your HTML element
13:54
You can do $(b).bootstrapTable('refresh') - wrap the element in jQuery.
@LoopingDev bootstrap is a jquery library. You need to have jQuery.
I dont mind using Jquery, it's just the entire script is in js vanilla, except for this line only
there is no reason to put a lint on something without wrapping it first
@KarelG I do have it, I'm just leaning toward Vanilla JS more. so Whenever I stumble on a Jquery call, I tend to convert it into vanilla js
const bootstrapCommand = command => el => $(el).bootstrapTable(command);
const refresh = bootstrapCommand('refresh');
/* ... */
let b = document.querySelector('#table_test');
refresh(b);
If you want to squirrel it away
13:57
it's better to have a tool function for that
let me try it
so that you know that separate module still uses jQuery
/\
that actually worked! , so cool to see it working that way^^
thank you

but I understand that it would call jQuery anyway so maybe I should just accept the fact that jQuery will be involved within my code to a certain stretch
@KarelG I got it, I guess there is no way around Jquery with bootstrap ^^, thanks alot :)
@BeerusDev o/\o
14:03
Happy Friday
thx, happy Friday to you too!
if anyone knows how to send udp on nodejs and/or listen to udp on ubuntu, please take a look here: stackoverflow.com/questions/66709577/…
what's this time format called = 2021-03-19T11:07:48.000000Z ?
@Orhan 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.
@Orhan ISO 8601
UTC is the time zone
14:06
I know
I realized that as i typed it lol
@VLAZ thank you so much
@VLAZ You can replace jquery with vanilla for bs -> One example here with BS5 freecodecamp.org/news/bootstrap-5-vanilla-js-tutorial
wouldnt recommend it thou
@iLuvLogix wow, It's quite interesting, the best part is the conclusion part.
Conclusion
If you have followed along this tutorial you should now be able to use the most popular CSS framework without the need of requiring jQuery in your project. This lets you save up to 85 KB of data and makes your website faster! Congratulations ?
:D :D
@iLuvLogix yeah I know the documentation but "it's not working"
@LoopingDev yeah, what a gain
14:13
^^
And am wondering if it's due to nodejs or due to how I try to listen to incoming udp traffic
@paul23 "it's not working" -> like our govs? ;)
@VLAZ how about this one 2021-03-19T14:28:39.100+03:00
@paul23 try npmjs.com/package/dgram-as-promised as a promisified alternative
@Orhan Same. It's just in a different timezone
14:16
@paul23 or here openbase.com/js/udp-request/…; for a list of other alternatives
14:31
how can I convert 1 or 0 integer value to boolean ?
...
it is already truthy/falsy?
no I get 1 or 0 in my rest api
as a string or as a number?
well if (1) will handle what's in that block
ah right, can be a problem if it's string
14:32
I mean, if you really want it to be an actual boolean... returnValue === "1" ? bool = true : bool = false
No.
No no no
don't do that anymore
Is that better?
never assign to something within a ternary
Oh sorry my value was string
14:34
you can simply convert it to a number and rely on the truthy/falsy coercion
and I try parseInt("1")
fix the api
Is it possible to see what platform a website was built on
but ^
I am assuming yes?
14:34
@KarelG ok then. @Orhan yourBooleanVariable = APIReturnValue === "1";
really. have it as a number or even true/false
Okay, I'll fix my API. I'm using varchar(191) in the laravel/MySQL for api
Sorry, I was interrupted
or, like karel said, just use a conditional setter
14:36
bool ? true : false is a big antipattern
Just use that bool or condition
antipattern? so is that good or bad?
antipattern === bad
I mean for a setter you can literally just go:
variable = value === condition;
Yeap
but then don't go if (variable === true)
14:38
xD
I have witnessed that
Well, unless you explicitly want to check for true
Like, wouldnt that only be useful for the sake of detecting a boolean value that equals true
wouldnt that return false for, for example, a string with a value, or the number 1
Exactly
14:39
i mean
if it's preceeded by your variable = value === condition;
I mean, Im lazy, and I barely ever type check because most of my coding is pretty static... (Except when I make classes...)

So I just go "if (value) {}"
it's kinda pointless to check if it's what you just set it to
I found some use in if(x === false), where x is "nullable"
if (value) {} is usually fine
if (value) won't work here
@MisterSirCode this.run = parseInt(this.system.value) is enough 😂
14:40
Unless you're getting '0' back
gotcha blame type coercion in javascript
@Cerbrus It just checks if the value exists, or is true, so its pretty universal.
!!> !!"0"
|| alive
14:41
@MisterSirCode You don't need to tell me how js works ;-)
@KevinB true Logged: `` Took: 0ms
> Took: 0ms
Yea right
@Cerbrus gotcha add ~
@Cerbrus Sounds like a good case of Delayed Frontend, Perfect Backend
14:43
<Insert joke about yo momma's front end>
Is that a thing the younger generation knows? Yo momma jokes?
So I get a value from API, like %34 I need only 34 what's the best way in js?
`
$value = "%34"
`
expected;
34
right
so do it
@Orhan (backtick code blocks only work in single-line messages)
14:49
I existed in the same generation as you guys, simply because I lived in an old town place in the sticks up north.
Felt like the 80s-90s there. Moved down south, suddenly there was such thing as a playstation 3..
Heck.. I wonder if Id be even barely interested in technology / programming if I still lived up north
Yea that's not the same, nor an answer to my question
To answer your question... yes, we had yo momma jokes
nor really comparable. there's rural old towns in the south too
That sort of thing became "uncool" around middle school
@KevinB Well, yes, but I mean, real in-the-woods sort of place up north, no cities / towns for 20-60 miles
Lol
yea
the south has them
14:51
I didnt know computers were a thing when I was young. my family didnt really take in that sort of thing
And Im 16...
The most we had was an old TV.
Watched Tom and Jerry a lot
in fact there's 5 counties surrounding this one that fit that description
True
I didnt live in canada or anything.. Well.. I was close
canada had phones
01:00 - 15:0015:00 - 21:00

« first day (3807 days earlier)      last day (1365 days later) »