« first day (3287 days earlier)      last day (1644 days later) » 
02:00 - 22:0022:00 - 00:00

2:53 AM
🚽
 
 
8 hours later…
10:28 AM
any way to create html sigs in gmail 2019?
 
@SuperUberDuper so try adding html to the signature and sending an e-mail to yourself
though I doubt they support it
 
just cant
really sad
 
@SuperUberDuper uhm... just use the editor?
 
10:50 AM
yeah but it kinda sucks
 
it goes well imo
there is no point to have a webpage as signature o.O
 
certainly being able to use html in your e-mail signature would allow that
but that's not probably what his intentions were
or her intentions... we're being gender friendly these days
 
11:14 AM
Anyone that worked with amazon SQS queue in the past?
 
no, but I have worked with amazon SQS queue in the future
 
lol
 
The future is now
 
back to the future
 
even the image upload doesnt work in teh gmail editor
its a He btw
 
11:31 AM
@SuperUberDuper I read that there is a way if you upload an image to your google storage and link to it that way
but it only works if it is coming from your storage if I'm not mistaken
 
11:49 AM
yeah even that gives a broken image link
maybe the storage needs to be public
but even uplaod from comp is enabled, yet doesn't work
 
there are multiple options
the regular image upload (not the gdrive one) generates a public image AFAIK
could be that it got changed
I just keep my private signature simple.
my business has some html stuff in it. But that is easily done in Office365 outlook's settings.
 
I wasn't kidding when I said no, sorry :P
I'm really not familiar with that
 
12:09 PM
thanks anyway buddy solved it
Not sure why it happens, most of the times I post a question i figure it out 2 mins after
maybe ill always give myself extra 2 mins before posting a question everytime xD
 
Believe it or not, I cant find anything on Google about this and was wondering what the % sign is for here?
i = i % var.length;
 
% is the modulo operator
Surprisingly this was the first result on google for "javascript percent sign"
 
@BenBeri better to answer your own question
but you have deleted it instead. That is ok.
 
Thanks @geisterfurz007 my gut feeling told me to query that but like playing Who Wants to be a Millionaire I changed my mind thinking it would take me elsewhere. I only tried Googling it as
i = i % var.length
Would you mind breaking its use down into simpler and shorter meaning?
in this instance
 
Yeah that won't help a lot :D
Best suggestion I can give is to search for "<language> <method name or character in plain language>"
@Stuart It's just a shortcut for the if statement in the question of the post I linked earlier.
 
12:24 PM
why is javascript Date giving me 9/3/2019 as the date
It should be returning 10/16/2019
 
@TaylorSpark zero based
 
Nice link @geisterfurz007 I hadnt looked at "this" b4
 
Thanks
 
cerbrus I dont really get what thats supposed to mean
 
12:25 PM
You're welcome :)
@TaylorSpark What exactly are you doing to get that result?
I assume that you are not respecting the month returning a zero based value and the day returning the day of the week instead of returning the day of the month
You are using getDay instead of getDate, I guess?
Or was that Java 🤔
 
im just doing this:
  var date2 = new Date();
  var years = date2.getFullYear();
  var months = date2.getMonth();
  var days = date2.getDay();
I got realllllly bored and decided to replicate the windows 10 UI (and its pretty good so far) but the clock is being a pain.
 
getMonth() + 1 (as getMonth is zero-indexed)
getDate() (instead of getDay because getDay returns the weekday index with 0 being sunday I think)
 
ok
there we go
now I should be able to just apply an interval to update ti every 5 seconds and I should be good
 
I tried using an animation frame but it didnt work :P
maybe Im using it in the wrong way
I always thought an animation frame just ran the function many times per second
but it only seems to do it when talking about canvas
nevermind, intervals dont work either ;-;
 
12:45 PM
Hey does anyone know how I coudl expan my SVG so that if I hover in the whitespace around it, it will change the fill of the SVG
I can use :hover on the svg, but it only works if I hover over the parts of the image
Nevermind, found the + operator in CSS
 
12:59 PM
Hey. I need "something weird": I have a Object.stringified() object that has, somewhere in the value, a JSON; so, something like this:

s = '{"en": "hello\n{\"key\": \"value\"}\nWorld"}'

since this is going to a csv file, i need to replace the "en" for ""en"" but I want to keep `\"` as it is; I was using

JSON.stringify(row[field]).replace(/\\"|"/g, '""')

but that turns the _value_ into {""key"": ""value""} as well.

does anyone know how i can make a proper regex that will ignore one and catch the other?
 
you can use negative lookbehind, but js does not support it completely
(only in chrome/opera AFAIK)
 
is there a pollyfill of sorts?
 
polyfilling a regex engine? :P
 
Hey, there are religions after all :P
 
If you're curious about that lookbehind: it is /(?<!\\)"/
 
1:05 PM
I could somehow make it into statements, perhaps -- and change the value before parsing it?
 
why won't you fix the initial string?
 
2
Q: npm install - how to avoid bowercopy dependency? And install dependencies using webpack

overexchangebowercopy is a deprecated tool for newer projects Below task(from here) is the grunt task using bowercopy tool as dependency: var JS_VENDOR_PATH = 'public/js/vendor', CSS_VENDOR_PATH = 'public/css/vendor'; module.exports = function(grunt) { grunt.loadNpmTasks('grunt-bowercopy'); grunt...

 
you can polyfill positive lookbehind
 
yeah, that's what I was thinking. But it only occurred to me now :)
 
it would just involve afterwards performing a second regex to extract the part you want
 
1:05 PM
I would need some help on this npm install issue
 
Is lazy loading images inside lazy loaded markup is overkill?
 
@Raimonds probably
is it possible you may never need to load those images?
if yes, then you could justify lazily loading them
 
Well guy before me boosted performance by lazy loading images using intersection obserrver
I took it step further and loaded html itself as async call
 
.__. why
 
1:10 PM
now I have both things running :D
 
the whole document?
I HOPE NOT
 
below the fold
using intersection obserwer
marketing (our king) said we want site FASTER!
how faster?
- speed of light

So we are working on it
 
"Speed of light" ok, so fiber connection?
 
Couple months ago I realized we were shipping in dev mode, and increased performance 10x by not doing that
 
haha
Good thing to bend to your advantage in the next performance review; I made the app run 10x faster.
 
1:20 PM
@Raimonds add a loop on some strategical locations that counts to 100000
 
Make it run 2x faster, then you can post performance increases every month
 
will be handy someday
 
@KarelG before migrating, I would like to understand, how npm install worked here? chat.stackoverflow.com/transcript/message/47560493#47560493
Is this something to do with npm version, that I use?
 
could be.
@SagarV see ^ , I am curious what's yours npm version
and do you have a local grunt lib? Or added it via npm?
 
user7437554
1:47 PM
if (variable) { }
 
user7437554
what's the condition there?
 
user6105689
Hi there, how can i change a word with pure html with replace:

i.e: .replace('hello', '<input type="text"></input>')?
 
you need to clarify that better
@santimirandarp whatever variable is?
 
user7437554
@KarelG any variable defined as var nameOfVar;
 
Yeah variable is the condition
 
user7437554
1:52 PM
I don't get why it returns true/false if the variable exists or not
 
JavaScript will convert the value of variable to a boolean value according following a set of rules. For example if the value of variable is null, undefined or 0, it is read as false in that condition.
!!> const x = undefined;if(x)return "x was read as falsy"; return "x was read as truthy";
Right; Caprica is dead.
function testIfValues(x) {
  if(x)
    return "x was read as truthy";
  return "x was read as falsy";
}

testIfValues(undefined);
You can play with that function and see what values are interpreted in which way.
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… You can also read the docs on Boolean which go into this as well (because the constructor of Boolean uses the same conversion as the if statement (as far as I know at least)).
 
@santimirandarp javascript has a boolean coercion, making a variable "truthy" and "falsy"
for example in most language if (variable != 0) is done to do an action if the variable is not zero
but in javascript, doing if(!variable) is sufficient because if (!0) is valid for javascript
for ref, you can consult this "falsy" - MDN reference
when having if(variable) and assume the variable is not defined (got declared but not instantiated), then it evaluates to false
because undefined is falsy
 
user7437554
2:07 PM
yees, im reading this post too stackoverflow.com/questions/35642809/…
 
anything can be truthy or falsy
my cat? truthy
 
user7437554
but didn't know which keyword to use to do the search
 
My orange juice? Falsy
 
user7437554
@KarelG yes, thanks :)
 
user7437554
Is it a function in the string object that classifies the variable as true or false?
 
2:12 PM
@santimirandarp I think it's just built-in language mechanic
 
user7437554
nice. I ll cite your reply
 
user7437554
ha :)
 
in the sense that you cannot simply override a function and have it work differently
 
user7437554
oh, I see...; thanks
 
@santimirandarp everything is considered truthy unless those values that is listed in that "falsy" page
I know it from my head: false / 0 / empty string / null / undefined / NaN / document.all
 
2:33 PM
I have a datagrid which executes a callback when im pasting stuff onto it. It executes the callback function once for each cell that is modified by the paste.
I want to save this data using a single network request
so i need to have a way to combine this data i get from various callbacks
my question is, how do i know when the callbacks are done, so i can proceed further, ie combining the data from all the callbacks into the network request
 
just set an timeout function
if new callback event got fired, clear it and renew it. If nothing done (timeout), send data
 
ikr, but i think that's not very elegant
 
3:05 PM
Hi guys ! I need some help, and an opinion, please.

I'm trying to reuse this gist => https://gist.github.com/ModPhoenix/f1070f1696faeae52edf6ee616d0c1eb
 
uhoh
 
It is about interceptors with axios.
The problem is that I can't understand what onRrefreshed() is doing, because as I see, isRefreshing always will be false.
 
wat
it'l be true while that request is happening
That's simply to prevent the logic from trying to refresh the token while a refresh is in progress
 
Yes, but onRrefreshed what is doing here? Because is calling some callback
but for example, subscribers starts empty
and is fill, when subscribeTokenRefresh is called, after onRrefreshed. I can't understand that
 
When refreshing is done that isn't the case
(unless of course only one request caused the refresh)
 
3:12 PM
Ok, suppose the first request causes an error 'cause the token is invalid
status === 401 will be true
 
right
 
let isRefreshing = false;
 
wait
no
that second line is in a callback.
it doesn't happen until the refresh is complete.
If another request comes in before it is complete, that array won't be empty.
 
Yes, you are right
you mean, the case when two request one after another with an invalid token?
 
right
that's the whole point of the subscribers array and that logic.
 
3:17 PM
ok, understood... but
what happens if is only one request with an invalid token?
 
nothing different
it's handled the same
a refresh request happens, the original request is attached as a callback and pushed to the array
when done, the array is processed
 
yes, but onRrefreshed will do nothing, because subscribers is empty
 
no
lol
 
no? haha why?
 
subscribers = []; happens after onRrefreshed(data.access_token);
subscribers is only cleared after the callbacks have been called.
 
3:20 PM
Yes, I know, but see that subscribers starts some lines before:
let subscribers = [];
 
Right
 
and so, if is the first request, subscribers is empty
 
and subscribeTokenRefresh gets called every time a request comes in with 401
thus pushing it to the array
which happens on the first one, as well as every one after that.
 
yes, but that is my question, what happens in the first request to onRrefreshed, because subscribers is empty at the beginning
?
 
it doesn't matter that it was empty
it isn't empty when onRefreshed is called
 
3:22 PM
onRrefreshed is calling a callback that doesn't exists
 
that's not true
The first request comes in. A refresh request is sent. A callback is added to the array.
 
'cause the promises?
 
When the refresh request is done, the array is processed, teh callback is called, and then the array is emptied
because asynchronous logic
 
Ive got a function inside an event listener but the func is not doing anything when called. Not even anything in console log
 
All the promise does is give you an interface to use .then on
thus matching the original return value of an axios call
 
3:24 PM
yes, you are right, the callback is called
my goodness, you are right
@KevinB just one more question ...
When subscribeTokenRefresh is called, the subscribers it is not empty?
'casue of this:
onRrefreshed(data.access_token);
authAPI.setAccessToken(data.access_token);
authAPI.setRefreshToken(data.refresh_token);
subscribers = [];
 
Hello Guys.. I have posted a question stackoverflow.com/questions/…
Can somebody please help me out?
 
@robe007 subscribeTokenRefresh happens before all of that
The logic there seems a bit... inefficient though
If it is already known that a refresh is in progress, there's no reason for it to continue sending said requests waiting for a 401 to come back.
but i guess that's the only way to handle it with an interceptor like that
(not all that familiar with axios)
 
subscribeTokenRefresh happens before all of that? How that is possible?
 
@BhaskerYadav your question is too broad.
generally we want one question per question. It's ok for there to be multiple connected questions, but your questions are not.
Is this the correct approach? If no, whats the better approach ? is too opinion based
 
3:41 PM
ok.. will chop it out
 
"Will this be able to handle say 1000 concurrent users in an environment with 8gb ram, ubuntu 16 and 2 CPUs?" depends on the code
 
cv it then
 
i did
 
😛
 
"What should be the ideal interval time to callback the token service, ideal time to update token at socket server ?" again depends
"What if socket disconnects, how to make it reconnect again ?" can be a question on it's own, but will need more info
"Is it scalable and maintainable?" err, what?
 
3:43 PM
@kev
 
@robe007 must be called somewhere. Just dig in the code
 
@KevinB I have trimmed the question
 
@robe007 That logic doens't happen until after a refresh request has completed. At that point in time, a request (if not multiple) has already come in and received 401's, thus populating the array.
 
OK, so if I understand now, the logic will be:
1) onRrefreshed
2) subscribeTokenRefresh
3) subscribers = [];
?
 
3 2 1 3
 
3:47 PM
4) meh
 
or 3 2 2 2 2 2 1 3
 
haha
but ... why 3 first if subscribers = []; is after onRrefreshed?
 
because the initial let subscribers = []
 
See that step 3 as "refreshing state"
If you don't clear the array, then the state is still at that request you were making
 
4:05 PM
Ok, but when I said 3) subscribers = []; I was talking about the line 44. not the line 29
 
@KarelG 6.10.2 and I don't have local grunt lib.
I never used that thing before
Was lil bc. DIdn't noticed your message, @overexchange
 
Anyone got a second to look at some very basic JS code w me?
 
@Stuart vanilla?
 
Ive almost got a home rolled script working but struggling with tying it all together
No, Just hand rolled JS
Ive got everything working individually but in a jam getting it all tied together
 
What's the error?
 
4:18 PM
NO errors in console
or anywhere that I see
working example
All is fine except that accept photo link isnt calling functions its suppossed to be
line 92-93
It alerts but nothing happens on lines 92 & 93
 
Clicking next in frame throw an error
Are you sure about this line bikeOutlines[i] = "<img src=" + nextItem() + ">";?
bikeOutlines[i] = "<img src=" + bikeOutlines[i++%bikeOutlines.length] + ">";
This is what it will do
 
Oh I meant 93 and 94
Even if I comment out that line, 93 and 94 still do nothing
but good point and thank you
 
4:43 PM
Just to make sure, the expected behavior is, move the captured image along with frame to bottom and refresh the canvas, right?
 
No...
expected behavior is:
Capture the photo as it currently does but after clicking "Accept Photo" I want it to move to the next overlay and ready the camera for the next pic with the next overlay, overlayed
Ignore the black background bottom part. Thats just my scratch pad for iterating thru array
of outline images
Everything seems to jive (for teh most part), Its just that 93 & 94 are dead
and I believe Ill have more issues to come, Im just real hung up on this one
 
@SagarV Do you suggest me to install grunt as well? Because I see grunt not found error...
so npm install grunt
but no luck
or change the npm version?
My goal is to just make sure.. dependencies get installed without any issue. with whatever npm version
depcrecation is not the agenda for the task
 
5:05 PM
@Stuart renderOverlay is continuously executing even after capturing the image. Try putting a console.log(1) in the function and you can see it's giving heavy load to the browser
@overexchange I didn't used grunt in the past. I simply cloned the repo and run npm i
 
@SagarV Great Tip, Thank You. Im on it right now
 
@SagarV how to perform this same task using webpack?
Am new to JS, my goal is to add this stuff inn CICD pipeline
 
@overexchange try npm i -g grunt
@overexchange I didn't have any experience on that migration. Let me try
 
Hey guys, someone who understands graphql to help me?
 
@SagarV WHOAAA!!
Excellent tip and I dont know anything about console.log(1) but it works and shows me something to work with
Awesome Tip, Thx
 
5:09 PM
$ sudo npm i -g grunt
/usr/bin/grunt -> /usr/lib/node_modules/grunt/bin/grunt
+ grunt@1.0.4
updated 1 package in 5.04s
$ npm i
audited 197 packages in 1.942s
found 29 vulnerabilities (6 low, 6 moderate, 17 high)
  run `npm audit fix` to fix them, or `npm audit` for details
$
@SagarV above is the output
I donot see bower copy task getting executed
 
Cost of a hyphen(-) in firebase => 40+ hours ;p
Learned lot of things while trying to solve it and the errors thrown in cloud functions log are not helpful at all
@overexchange try running grunt
or npm i
if grunt is not working, you've to install grunt cli
gotta go. Ping me in one of your message
 
5:26 PM
Firebase is an interesting platform. Was considering it for this project, but the amount of writes I'm doing was going to costs hundreds of dollars a month lol
 
user7437554
5:38 PM
var example; example = function one(){return 2;}()
 
user7437554
sorry about this question shouldn't one( ) return some value?
 
no
!!> var example; example = function one(){return 2;}; console.log(one())
where's cap
Wait rlemon left
:(
 
user7437554
but why not
 
why should it
var example; example = function one(){return 2;}; console.log(example)
> [Function: one]
scope
 
did you miss the ()
 
5:46 PM
no
 
because, calling the function does impact what's happening here
 
I am pointing out that example refers to exactly what they wanted it to: a function named one
 
well, no
not if the () you conveneintly left off isn't there
 
but it is not accessible cause of scope
 
:p
it'd be equal to 2
one still wouldn't be accessible there ofc
 
5:47 PM
@KevinB what? Calling the function is different than the function itself.
 
Right
9 mins ago, by santimirandarp
var example; example = function one(){return 2;}()
example there would be 2
not one
 
user7437554
I think the right side is treated like an anonymous function, as if the one were not there...
 
user7437554
in both cases, with the () and without it...
 
it's expression vs statement
for example, if you did var foo = function bar() {}, foo will contain the bar function, but the bar function wouldn't be callable directly with bar()
If you instead did function bar () {}; var foo = bar;, you'd be able to call them both.
 
user7437554
@KevinB but what's the use of bar?
 
5:51 PM
demonstration
do you mean, why would you name a function?
 
user7437554
I mean, it's not a variable
 
user7437554
you cant call bar, right?
 
var foo = function bar() {} creates a function named bar, and saves a reference to it in foo.
The primary benefit of that is error tracing
though in this specific case, doing var foo = function () {} would still give you a function named foo
 
user7437554
but if there is a function named bar why I get 'typeof bar' undefined?
 
because you didn't define a variable bar
 
user7437554
5:54 PM
neither do I when writing function bar(){}, right?
 
user7437554
but typeof bar returns function
 
function bar() {} does
lol
read the link i provided
it's all there
 
@KevinB ohhhh I see what you are saying
 
user7437554
fine, thanks @KevinB
 
6:00 PM
Hi, Have any plugin/library in javascript for take photo from webcame and have must option tu edit that picture.??? same as for mobile web
?
 
user7437554
:( too many things
 
I have used this but it's simple open webcame and take picture https://github.com/jhuckaby/webcamjs
But need to option of edit picture
edit, save then upload
?
 
@RaheelAslam How do you need to edit?
Like you want to give the client a better experience so they don't have to do editing offline or you need for security reasons
 
Because i have form builder project user drop the take photo field and take photo from webcam and edit picture then edit picture will save on server
it's client requirement
 
look at those links
or just search "js image manipulation"
 
6:15 PM
Thanks let me check these
@JBis for open camera do i need to add another library.? in those lib take photo option is not available means open web camera browser
 
@KevinB is there any difference between function foo(){} and foo = function (){}?
@RaheelAslam I'm sure you can pass the image data from the capture library to the edit library
 
6:38 PM
One is hoisted
 
 
1 hour later…
8:04 PM
0
Q: NodeJS - When dependency injection goes wrong, what should I do to solve this situation

Ben BeriI have a microservice that I wrote in NodeJS using inversifyjs DI Container. The main class for my service is being started like this: const worker: Worker = container.get<Worker>(ServiceTypes.Worker); ServiceTypes.Worker is Symbol.for like shown in their documentation. Now everything works...

might be interesting for some of you :)
 
8:55 PM
Can't read it if you delete it, my man
@Cereal whoa
did you end up going with GCP
 
9:31 PM
@forresthopkinsa nope, just using my shared hosting
 
ah
I think I could probably build my own cloud platform with all the old desktops I have laying around
 
02:00 - 22:0022:00 - 00:00

« first day (3287 days earlier)      last day (1644 days later) »