« first day (1947 days earlier)      last day (2996 days later) » 
00:00 - 13:0013:00 - 00:00

12:15 AM
anyone use web components in prod?
 
12:41 AM
soon maybe, but unfortunately not yet
 
I've been seeing many project on GitHub have separate folders for client and server. Additionally, each folder has its own package.json. Is that supposed to be a good practice or something?
 
Yes, the client and server should be as independent from each other as possible
You should be able to make a new client (e.g. phone app) without touching the server code, and you should be able to change the backend (e.g. switching from js to ruby) without affecting the client
 
Got it. It's kinda sad that there is barely any good tutorial that uses Node/React/Express/SQL
 
12:56 AM
You mean using react to render on the server?
Or just for front end stuff
 
Front end
 
Yeah, that goes back to separating the client from the server
 
Wait, you can render React components in the backend?
 
Sure
There are plenty of guides on how to build an api with node/express/sql
And plenty of guides on how to interact with an api using react
 
I already know Node/express and SQL pretty good. But I am just starting out with React. Basic isolated examples that use React along with Node/Express and SQL would be ideal.
React for front-end, that is.
 
1:00 AM
Is your api built already?
 
Yeah. I am actually transitioning a MEAN stack app to React. I don't mind re-doing the API. But right now, I have to spend a couple of months to get really good at React (from the documentation) and then actually be able to redo the Angular part.
All I really need is a simple authentication example that uses these technologies.
 
@Insane Welcome to the JavaScript chat! Please review the room rules. Please don'task if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
She's in love with you
 
I just talked to a bot.
 
Do you have your auth system set up on your server?
 
1:05 AM
Kind of.
Again, I don't mind redoing the backend API and stuff.
That's not a problem at all.
 
You shouldn't have to touch the backend
 
For example, I was looking at this:
But it's so over-the-top. I don't need all that.
 
Pretend there's an element <a> on a website that shows up only at certain times. Obviously I know how to find this element and .click() it using Javascript, but I'd like to do it not just when it's shown on the website. So, sure, I could use insert the element in an invisible iframe or something and click it that way, but is there any way to basically to create it using Javascript for the purpose of .click()ing it without doing what I said? Does that make sense?
Basically replicate clicking the real element
 
Call the function that gets called when the element is clicked
If it's just the default href thing, window.location = url;
@DemCodeLines Yeah idk about that lol
 
I couldn't even get it to run.
 
1:10 AM
Anyway, if you need to add auth
 
@Meredith But if I don't know what that function is? It's actually not an <a>, it's a <span> element and the way I find it when it's on the page is basically getElementByTagName("span") then in a for loop I check "if .innerHTML = "Click Me"" and then I .click() that element and break the for loop.
 
There's a bunch of tutorials on how to add auth with react
They'll assume that you already have an authentication system on the server
 
So google react oauth or whatever
What are you trying to accomplish?
 
@Insane this sounds like XY to me
 
1:14 AM
@phenomnomnominal XY?
 
790
Q: What is the XY problem?

GnomeWhat is the XY problem? When asking questions, how do I recognize when I'm falling into it? How do I avoid it? Return to FAQ index

 
Well I'm not saying "that code should work" I was simply putting it there to describe how I'm clicking the element when it is on the page .. my problem is how do I replicate clicking it when it's not on the page
If that's still the XY problem I'm sorry
 
What are you trying to accomplish?
i.e. why do you need to click a bunch of elements
 
@Meredith Only 1 element will match the if condition. Once it's clicked it will go away, but I may want to click it when the element isn't on the page. i.e., like you said, basically call the function of it. so the workaround I figure could work would be inserting it manually somewhere invisible and then running that code.
 
What happens if you "click" a hidden element?
 
1:21 AM
well probably same thing.. I've tested it using local html editing on the page. putting it somewhere static like above the body tag. then running that code I sent, and it works.
so then I can run my JS code and it'll always work
because it's always there
if this doesn't make any sense just tell me
it's like if the "send" button on this page only showed up when you put your cursor in the text box. and I wanted to .click() the "send" button even when it's not present on the page.
 
Well, how would you bind a click event to the send button?
Something like document.querySelector('button#send').addEventListener('click', send);, right?
 
one moment
 
Or with jquery $('#button#send').on('click', send);
 
ok it worked. this is how
I'm using javascript not jquery
 
1 message moved to Trash can
@Insane Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
1:27 AM
sec sorry
 
Good, don't use jquery lol
 
for (var i = 0, max = all.length; i < max; i++) {
    if(all[i].getAttribute("id") == "sayit-button") {
        all[i].click();
        break;
    }
}
There we go, that's how I would do it. And that worked.
 
Do you see the problem with that code?
 
Do tell :P
var all = document.getElementsByTagName("button");
I forgot that at the top lol, sorry.
 
First of all you're looping through every button on the page, just to do one thing
 
1:30 AM
Could I find the button more directly?
 
How are you binding the click event to the button?
 
What do you mean?
 
Where are you defining what happens when you click the button?
 
I don't know. It's not my website I'm running the JS on.
That's why I said I can't just call the function that the button executes directly
 
Ohhh
 
1:34 AM
I do have permission, but past that I'm on my own.
Sorry If I should've said that earlier
 
So are you trying to build a chrome extension or something?
 
Yup
Exactly
 
And what does the extension do?
 
Without writing paragraphs, basically "presses" said button that's not always on the page. When that happens is a different story, but I need to be able to do it even when it's not present.
I just don't know if that's possible
 
You're allowed to write paragraphs if you want to
 
1:42 AM
It's more of a proof of concept. I know for a fact if I edit in the button using local HTML editing then run my script the function will run as if the button was generated naturally by the website.
The site is chat based, so there's a variety of functions I'd like to be able to do to make peoples lives easier. The elements might not always be on the page
i.e. the only way to open your own profile is to press your own name when you type in chat. that's.. lame
so that's a pretty good use case. without my name hyperlink actually being inserted on the page
 
Ok now we're getting somewhere
 
:P
 
In that case, you should know what their profile url is, right?
Probably something like /users/me/ or /profile/ or /users/:id
 
Yes, when you click your name it appends /profile/myname to the end of the URL. But physically redirecting to /profile/myname refreshes the whole page, naturally. That's even more lame. Thus I wanted to replicate pressing the hyperlink
Does that make sense?
Opening your profile slides open, kind of like on here. If you click a name it doesn't refresh the whole page to pop up the little dialog.
 
So now your question is "How do I open a page in a new tab using javascript?"?
Oh
 
1:51 AM
Make sense why I asked how to "replicate the click" (so to speak)? :3
 
Yeah I got you
One sec
Ok so on stackoverflow, when you click a name in the chat, it sends a request to the api
 
But nothing is appended to the URL. I don't think it works the same but the idea was close enough to get my point across.
 
Which will have all the info you need to generate the popup on your own
You just gotta figure out what the button does
Then how to emulate it
In this case, it's send a request to the api and then generate the popup on your own
 
So basically back to what you said earlier. Call what the button does
 
Yeah
 
2:02 AM
And I guess the problem is the same, I don't really know how to replicate it.
So I guess my original idea of "insert the link somewhere the user cant see then click it invisibly"
 
Except now you'll have to do some investigation to figure out what it does
 
Is probably the best bet?
 
Doubt it
 
Hm
 
You can right click -> inspect element, then there should be an event listener tab
Find the click event and read the code there
You might be able to just call that function on your own
Otherwise you'll have to implement it on your own
 
2:10 AM
Event listener
Why didn't I try that sooner
 
It might help to look at the network tab as well
 
Yeah thanks, I'll poke around
 
 
2 hours later…
4:27 AM
@rlemon Holy shit, that's cool. People are mindblowing :D
 
function filesToList (files) {
    // Whatever, don't judge me.
    files = files.map(function (file) {
        var url = file.replace(/^src\//, '');
        return '<li><a href="' + url + '">' + url + '</a></li>';
    });
    return '<ul>' + files.join('\n') + '</ul>';
}
Today in "code from the past"
 
 
2 hours later…
6:36 AM
Morning. Could someone tell me whats the pendant for ID's?
addClass('original')
 
Hi guys
Can you guys tell me which carousel plugin is best for performance and covers all kinds of scenarios?
I used to use carousel fred sel and was neat but it is now a paid plugin, so I moved to owl carousel and it has lots of issues and I cant seem to find a good free plugin...
 
@ImranBughio nope :?
@TechTreeDev not sure what you mean
 
 
1 hour later…
7:48 AM
hey guys! any tips on how to make a pure javascript code instead of jquery slideDown() ? thanks a bunch
 
8:02 AM
can onbeforeunload popup be overridden somehow?
I need to show a custom dialog box with SAVE NOW button on it
searched a lot but no real solution found
 
8:40 AM
hi
 
any ideas please?
 
9:05 AM
@techie_28 no. It's a part of the browser behavior. Resources gets allocated/unloaded during that phase. You can do something when that event got fired, but once your code got executed, you have to inform the browser that it may continue
also, popups gets ignored (read the HTML5 specs to be sure)
 
9:19 AM
ya Im getting to learn them now
 
I <3 AWS
 
java aws ?
 
@KarelG Amazon Web Services
 
is that a PaaS or something ?
like google app engine
 
IaaS
and yep
 
9:33 AM
@MadaraUchiha @room anyone has any experience with Payments through PayPal? I have a few questions I'd like to get feedback from.
 
@BenjaminGruenbaum Very little
 
@MadaraUchiha I want to know if I can charge a user directly through paypal in my site without going to an iFrame in PayPal. Other services let me do that - for example Bluesnap (it uses client side encryption)
 
@BenjaminGruenbaum Yeah, it's possible
The user authorizes all future payments, and you can charge them whenever
Alternatively, you can have the user set a monthly/recurring payment
 
eBay and Steam work like that (the first way)
 
9:37 AM
Have you considered braintree (just wondering)
 
9:48 AM
Link?
No, I did not. I'm absolutely clueless about the merits of various payment services
Oh, looks like Braintree are owned by PayPal, nice.
@MadaraUchiha anywhere I can get started? I remember you complaining a lot about their API - I want a form where the user enters their credit card and details and I charge them for the service provided. I don't want to have credit cards on the server and bonus points if it automatically fails if someone accidentally opens the page on anything but https (server should take care of that, but still)
 
Ah, no. PayPal's API is ok
It's Amazon's and eBay's I complained about.
 
Oh, good to know.
 
@BenjaminGruenbaum BreenTree is extremely simple and dev friendly, and cheaper.
 
@Abhishrek is it able to charge everything PayPal is able to charge?
 
@BenjaminGruenbaum afaik yep + it can also charge Apple and Android Pay
lemme confirm that :P
 
10:02 AM
Please do, thanks.
 
oh damn :-/ I didn't know that
although this is their official paypal announcement braintreepayments.com/features/paypal Braintree is Paypal + Extras
@BenjaminGruenbaum if you are cool with the first link BT is better :P if not ... lemme find the integration article I read about paypal (when integrating it in BatuaPay)
 
Looks like they don't work in Israel
 
Yeah. Sorry about that :<, also Direct Credit Card Payments are not allowed
in many countries. (Including India IIRC)
 
So there is no way to integrate a form into our site where we charge people without redirecting them?
 
you can use paypal's direct credit card
you accept the card -> you send a signed request to paypal
 
10:17 AM
That's the doc you sent me?
 
Israel is working
although that's just currencies, not countries :/
This forces me to have the credit card on my server developer.paypal.com/docs/rest/api/payments/#payment.create I need to avoid that.
 
@BenjaminGruenbaum :-/ sadly the only two people who do straight form are Stripe and BrainTree and Stripe supports fewer countries than BT
*corp not people
 
Bluesnap and ZooZ both do it.
 
Oh they are payment gateways
 
10:36 AM
@BenjaminGruenbaum That doesn't sound right
You have "payment_method": "paypal" to pay with a PP account
 
@MadaraUchiha I think he wanted to avoid that, and use paypal as a payment processor for direct card transactions.
> I want a form where the user enters their credit card and details and I charge them for the service provided.
 
Oh, then I don't think you want PayPal there, it's quite expensive for that.
 
^ Which is why I suggested BrainTree but turns out no BT in Israel.
Hi BadgerCat!
 
11:00 AM
M
@Abhishrek build not ready yet?
 
@jarvis Studying :P + I have an interview tomorrow. Should do it tonight at around 10 :p
 
chat looks total shirt on is 9 mobile
 
^ Microsoft Autocomplete <3
I also need to check angular specific gulp things turns out ngInject and other things exist for gulp
 
@BenjaminGruenbaum hey check the featured meta.programmers se post
 
11:16 AM
require("TimeSlice").guard(function() {(require("ServerJSDefine")).handleDefines([["SystemEventsInitialData",[],{"ORIGINAL_USER_ID":"100005401176739342"},483]])});
how extract "ORIGINAL USER_ID"
 
11:29 AM
!!nudge 20
 
@MadaraUchiha Nudge #1 registered.
 
hi
 
@Hello Welcome to the JavaScript chat! Please review the room rules. Please don'task if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
I have a question about java but not javascript..lol
but, this room is more active
 
@Hello That may be true
But we're not Java programmers, so....
 
11:32 AM
My question is more math related
I wrote a program and my logic has holes in it
 
@Hello Shoot
 
I think it requires someone to check my java files
like, I have a data definition class, and then implementation class
my program is like GoFundMe, and you enter your campaign name, type, goal amount, and then you enter donations until either you reach the goal or you want to stop
 
HAMMERTIME!
 
but..my math is weird
for determining the total amount donated to a campaign :(
and its 6:30 AM and ive been trying to fix this for 3 hrs
lol
 
Cant you simply add to a total everytime someone donates?
 
11:34 AM
@Miller Welcome to the JavaScript chat! Please review the room rules. Please don'task if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
yeah but its a little complicated
because there are two campaigns
and i have too many private variables and stuff :(
im just confused and hopeless
 
Im not familiar with Java unfortunately
 
ah, its fine
:)
 
@BenjaminGruenbaum why do you care so much about the credit card being on your server?
 
Did you make a campaign an object?
 
11:38 AM
yep
i instantiated two instances of the campaign class
my issue is simply just the addition haha, I think youd probably be able to figure out the issue just by looking at it
but i'm stupid and tired and i refuse to sleep until i get it working perfectly :D
 
Not sure if this is very "java" like, or even good practice, but did you a function on the campaign class to add to the campaign?
add a function*
Or maybe its more java-like to simply do

myCampaignObject.donations += newDonation

For example
That is, if donations is public
 
Hmm
so, heres what i have
umm
im so tired i cant even form a thought
but basically
 
If you going to share code, put it here
and send me a link
 
 
@Hello Let's start with this
What is your goal?
 
11:43 AM
the campaign goal?
lol
 
No, yours. The programmer
What kind of software are you building?
 
this is just for an assignment for my IT class
 
OK, what's your assignment?
 
its supposed to mimic GoFundMe
but only handles two campaigns
and then after all the details are gathered for both, it prints a report
my problem is just the calculations in both the ddc and implement. class
like, i know its probably really easy to spot my errors so i was just wondering if another set of eyes could check
Also, whenever I input donations, it never stops. I can keep adding values forever
 
@Hello What are the requirements?
 
11:46 AM
use object oriented techniques
instantiate two instances
of the campaign class
thats about it..
cant use anything more advanced
 
Those aren't the requirements
"It should be able to handle donations" "It should be able to have a goal and stop the campaign when it reaches that goal"
 
I can send you a picture of the requirements
its a lot longer
if that is what you meant :o yea
 
@jarvis who?
 
@MadaraUchiha nudge
 
@Hello, I've noticed you call

calculateTotal(donationTotal,donationAmount);

Which returns a value, but your not storing/using that value anywhere

Is that on purpose?
 
11:50 AM
I don't know if that method is even necessary..it isnt on purpose :( i forgot about it, I think I have too many additions going on (redundant code like that)
 
@MadaraUchiha I need to charge credit cards as well. Also, paypal accounts would still require PCI compliance
 
It's hard to think/work out what's going on with lots of redundant code lying around. I'd recommend cleaning up anything that your not using.
Makes it harder for yourself
 
I'm not sure what code to get rid of or comment off :/
 
15 mins ago, by Madara Uchiha
@BenjaminGruenbaum why do you care so much about the credit card being on your server?
 
@MadaraUchiha PCI DSS without it you are illeagal
 
11:52 AM
@MadaraUchiha because it's dangerous and illegal
You have to pass certification in order to legally do that.
 
@BenjaminGruenbaum You don't need to store it...
It being in memory for a short while as you call the API isn't illegal nor conflicting with PCI
You just need to be careful not to log it out or store it anywhere
 
@MadaraUchiha super illegal.
 
You call the API, toss the credit card number out, and you get a transaction ID back that you can store/use/return whatever.
@BenjaminGruenbaum wat
 
You're liable if anything on the way logs it, server logs, the load balancer Azure uses and so on.
 
@hell
 
11:54 AM
I am in hell
 
1 message moved to Trash can
@Miller Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
@BenjaminGruenbaum Load balancer is after or before the SSL endpoint decryption?
 
yes thats what I am using
i actually dont know where to add to the total
i can basically choose right?
 
@MadaraUchiha after decryption most likely, even if it doesn't store things - there'd still be the server logs on Azure, and we'd need to make sure at every step of the way they don't change the configuration to log stuff if it's even possible.
 
@BenjaminGruenbaum Server logs don't log POST parameters IIRC
And if they do, that needs to go away because that would also store plaintext passwords all over the place.
 
11:56 AM
@MadaraUchiha what if they persist the RAM of the virtual machine to a disk at some point?
 
hello
 
@yogihosting Welcome to the JavaScript chat! Please review the room rules. Please don'task if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
1 message moved to Trash can
@Miller Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com or pastie.org
 
Noo
 
@Hello also this is not the Java room.
 
The java room had nobody in there :/
well it was inactive lol
 
11:58 AM
I formatted it :/ oh well.

Yeah good idea, lets move to the java room
 
in visual studio javascript breakpoint not working??
 
maybe its not anymore
Okay
 
> "Your company does not store, process, or transmit any cardholder data
on your systems or premises, but relies entirely on a third party(s)
to handle all these functions;"
 
haha
 
@BenjaminGruenbaum I'm not sure you'd be liable for that. Especially if they do it without your knowledge.
 
11:58 AM
@MadaraUchiha
 
@MadaraUchiha depends on countries
 
how to apply breakpoint in javascript in VS 2015??
 
I know the most about India :P, and its illeagal to touch credit card details on your server at all.
@yogihosting which environment browser ? node.js ?
 
breakpoint not applying in any browser in VS 2015 for javascipt code.
 
@MadaraUchiha it's fine if I encrypt it on the client side and then only the PCI complaint party decrypts it.
@yogihosting simple - write code without bugs.
 
12:01 PM
@BenjaminGruenbaum that's crap.
 
!!whoosh
 
lol
@BenjaminGruenbaum Are you aiming to be PCI compliant, or are you aimin to avoid having to be PCI compliant?
 
@MadaraUchiha to avoid
> it's fine if I encrypt it on the client side and then only the PCI complaint party decrypts it.
@BenjaminGruenbaum whats the problem with iframe ?
 
@Abhishrek brand, I'm guessing
You lose the ability to style it as part of your site, use error messages of your own, etc.
 
12:06 PM
IIRC steam uses it too.
@MadaraUchiha doesn't paypal has those customizable hosted pages
which are PCI/DSS compalient
or did they drop support ?
 
@MadaraUchiha to avoid.
@Abhishrek I have no idea how to do that with PayPal.
 
In that case, your choice is to either to use their "Checkout With PayPal" button, which handles all of it for you
 
Is it possible to make hide, show smooth globally without using fadeIn or css transitions individually on each element?
 
Or to not use PayPal, because their REST API requires you to be PCI compliant yourself.
 
Do they not have another API that does not require that?
@MadaraUchiha that means I have to redirect them to PayPal in order to do the actual processing though.
 
12:10 PM
@BenjaminGruenbaum Correct.
 
@MadaraUchiha BrainTree also does it - look at the nonce: developers.braintreepayments.com/start/hello-server/node
 
But BrainTree apparently doesn't work in Israel
 
Correct.
 
Which is unfortunate (although if the choice is between not working in Israel and being able to not be PCI compliant in the US, there's not really a choice)
 
12:26 PM
It is, there are other payment providers that work.
Maybe we'll have to eventually just register in the US, we're trademarked there anyway.
I'd totally go for a year in NY
 
@BenjaminGruenbaum :P in USA you can use many many services in payment that are cool as hell
@BenjaminGruenbaum They used to have a Payflow Gateway
but that needs Paypal Pro
in that you can do custom branding and what not
 
Can we keep that in our site though?
We don't mind paying, let's say, $5000 a year for a service we're satisfied with.
 
12:43 PM
Hey guys.. :)
I'm using Angular2 with TypeScript.
However, I am getting some crap tonne of errors, which I don't know what causes them.
 
Hi what's your problem?
 
@Sino Welcome to the JavaScript chat! Please review the room rules. Please don'task if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@CapricaSix thanks ;)
 
@Sino My errors: prntscr.com/a33tgr
I'm quite new to Angular2 w/ Typescript
 
12:57 PM
Random question popped in my head, what happens if you're looping over an object yielding promises inside, and the object is modified while the promise is doing stuff? Does the iteration continue like before?
 
00:00 - 13:0013:00 - 00:00

« first day (1947 days earlier)      last day (2996 days later) »