« first day (1528 days earlier)      last day (3434 days later) » 

2:02 PM
@FlorianMargaine 7-8 days to go, rather short
 
@Meredith hey! :)
 
Hey
 
how r u? :) finished your exams? :D
 
Yep, all done
 
& 'well' done? :P
 
2:05 PM
Idk I'm too scared to check
 
lol
@Meredith if you have some free time, invite me in room :P i'm still stucked with that f*ckin project... :/
 
@AwalGarg true, but sometimes line numbers alone don't help you, and sometimes you don't have line numbers.
@Julo0sS by "debugger" I mean using breakpoints, inspecting values, stepping through execution.
 
2:21 PM
so, today at school we kind of discussed about the death penalty... we pretty much all agreed that it wasn't a good thing for a society like ours (talking central/eastern europe here), and the vast majority said that it should be removed everywhere. Being the crazy kid that I am, I said to the class (which is almost all christian):"If death penalty was never there, Jesus may not have died because of society, and christianity may not have gained as many followers, ending up in it's extiontion...
 
And?
 
it follows: no death penalty, no christianity". The teacher was atheist.
 
Also, I don't think what he got was really the death "penalty"
 
it was cool: suddenly the class started thinking that death penalty was necessary...
 
It was more like, "You're taking away some of my power, you must die"
As far as I can tell
 
2:23 PM
and that it was in some way scripted by god for death penalty to be on earth
 
Hahaha
 
well, technically it was death penalty: he was legally crucified
 
Yeah, because the person judging him was the person making the laws
Again, as far as I know
I haven't really read the Bible or anything
 
me neither, but I've heard that actually the guy who made the laws didn't want him dead, it was just the society, and they made a request to the roman official, which could do nothing but say yes
 
@SecondRikudo agreed.
 
2:26 PM
anyway... just thought I should have shared this with someone over the internet
I can go back to homework
 
anyone good with grep here?
 
!!welcome Awal
2
 
@Awal Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@CapricaSix Who are you? Why did you ping me? Please read the room rules and don't ping random people.
xD
@SecondRikudo Halp plx. My regex is a proper pcre regex, but it won't work with grep :( It works on regex101.com though. :/
 
grep -E?
 
2:31 PM
grep --regex=\d+\.
^this, is what I did.
@FlorianMargaine tried that too
 
yeah, use -E
grep doesn't support PCRE afaik though
 
20 secs ago, by Awal Garg
@FlorianMargaine tried that too
@FlorianMargaine but man grep says it does...?
 
where?
ah
with -P
 
never used it... I should
although it says "experimental"
 
2:35 PM
grep -P \d highlights all the d character instances, instead of digits :/
 
and grep -P "\\d"?
 
neither digits, nor d.
owwait
 
works for me
 
but... it wasn't working last night :( now it works.
 
for the record, it's because bash escapes strings with \ too
 
2:38 PM
k... thanks @FlorianMargaine
 
it's the same as when you use new RegExp() in js
 
rov?
wow this grep thing is pretty cool
 
?
rov = reopen vote
 
ah
@FlorianMargaine I haven't used grep much prior to this.
 
2:49 PM
ok
look at find, it's nice too
then advanced level is sed and awk
 
hmm..
Oct 8 at 8:44, by Zirak
The more you learn, the more you realise how much shit you still have to learn
 
@FlorianMargaine sed and awk are still ancient greek to me.
 
sed is quick to learn tbh
awk is another beast on its own...
sed is just sed -i.bak 's/to/replace/g' to replace something in all files
 
@AwalGarg wait until you CROSS THE BEAMS
ls | grep | sort | awk
mind exploded
 
3:08 PM
@AwalGarg That somehow sounds familiar
 
Guys OAuth2 question:
You point the user's browser to the authorization endpoint of the service, passing it your app_id and a redirect_uri
Then the user's browser is redirected back to the redirect_uri which is your domain, with a GET variable that specifies the authorization code
Right?
My question is, isn't the authorization code sensitive? Is there a reason we can pass it normally like that?
 
sensitive to who?
 
Can't an attacker use that authorization code?
 
I have to check oauth's system again
although if it's https, there's no issue
 
Wouldn't it be wiser to send a POST request to the server?
With the authorization code?
 
3:18 PM
how is POST safer than GET?
 
@FlorianMargaine Doesn't pass through the browser
From the service to my server directly.
 
ah, I see
 
With an endpoint I set up in advance
 
gotta check the protocol again
 
3:20 PM
@SecondRikudo You can just see this with Fiddler right?
 
@Jonathan As long as the user's browser is redirected, anyone with access to the browser (the user, the user's machine, malicious processes on the user's machine) can access it.
If the service (i.e. Google) sends a request to my server directly, the client is not exposed to the underlying credentials.
 
Ah I see
 
That said, anyone can see the cookie auth...
 
@FlorianMargaine Cookie?
 
The sessid
 
3:24 PM
Yes, that's true...
Oh, I think I got it @FlorianMargaine
The authorization code is checked against my app_id and app_secret, without those the auth code is useless
And since app_secret is... secret, I think it's okay.
 
user image
4
@SterlingArcher ^
 
@FlorianMargaine SterlingArcher is afk: sleep
 
@FlorianMargaine Hahahahaha
 
Why do we need session cookies btw? Can't the server just keep track of a session based on the ip?
 
@Jonathan what if you and your mom go on facebook from your home?
 
3:27 PM
I'd say she shouldn't
 
Hahaha
 
:D
Ok
 
and IP spoofing is easier than stealing a session cookie...
even works over https
 
3:43 PM
For the first time, I wrote css for an entire component, and it came out exactly as I wanted it to be, at the first try. Time to celebrate.
!!afk
 
-1
A: How can I remove the time from Moment.JS date?

Martin McKeaveneyICC.Utils.formatCalendarDate = function (dateTime) { return moment.utc(dateTime).format('LL'); };

Sanity check, I'm not wrong here, am I?
Oh, I understand your reasoning.. This is actually copied from some code that I wrote in context working with RGB colors & ICC profiles. Careless there. Apologies. — Martin McKeaveney 41 secs ago
I still smell bullshit.
 
why?
the code seems to be fine
 
Check before his edit
It's exactly the same code as the one I linked in the comments
He just changed the string he passed to .format()
 
@SecondRikudo ah...
 
4:14 PM
I have an ajax call to a PHP file, where I do some stuff, print the values in JSON encoded form and then refer to that JSON object using the data variable in the success function. However, instead of printing the JSON stuff from that PHP file, the data variable is simply printing the whole index.php (in which it resides). Is there any way to check the source of data and where it's getting this value from?
 
@DemCodeLines The server's likely not running PHP or is not configured properly.
 
@SecondRikudo It's running PHP. Everything else is rendering right.
 
It's printing the source of index.php?
As in the actual PHP code?
 
The thing is, even if I do print "hello world" in the PHP file, the ajax call's data variable continues to print the source of the index.php page.
 
0
A: How can I remove the time from Moment.JS date?

JonathanI'll plagiarise better: return moment.utc(dateTime).format('MM-DD-YYYY');

@SecondRikudo Plagiarised better this way? :)
 
4:16 PM
@SecondRikudo No, it's basically embedding the index.php file.
 
You're not making sense.
 
Maybe if I tell you the entire process (quickly), it will be easier to underrstand:
 
@DemCodeLines do you have the php open tag?
 
1. User begins to type a name
2. JS intersects on `keyUp` and looks at the text. Which is then sent, via an AJAX call, to a PHP back-end file that uses that text to query the DB.
3. External PHP file does `print`'s that correct values from the DB.
4. In `success` function, I do `$("#text").html(data);`
Problem is, data is basically returning as the code behind index.php
so when I browse to index.php and type in the textbox, the #text element embeds another index.php inside it instead of displaying the text from the PHP file.
@FlorianMargaine I don't think I have missed any tags. I checked twice already.
 
@DemCodeLines don't do this job in index.php
And don't blindly .html(data)
 
4:23 PM
The JS itself is in lib.js
 
Have the server respond with JSON or some other format that represents the results of the search, and make the DOM nodes yourself.
 
I tried doing console.log(data) and it printed the code for index.php in the console. Not the actual source code, but the same HTML code you see in the page source.
 
1 min ago, by Second Rikudo
@DemCodeLines don't do this job in index.php
 
@SecondRikudo Sorry if I completely misunderstand your answer, but the JS is not inside the index.php file.
 
The generation of search results
Server-side
Don't do that in index.php
 
4:25 PM
It's not.
I failed to explain...
 
Send an AJAX request to search.php
Not to index.php
 
@SecondRikudo I was about to type that. The stuff where I query the DB is in a totally different file and that's where I point my ajax script to.
 
5 mins ago, by DemCodeLines
Problem is, data is basically returning as the code behind index.php
Explain this please.
 
var elt = $("input#user_search").val();
$curr = $(this);
$.ajax({
    url : "../front/tools/u.search.php",
    type: "POST",
    data : {val: elt},
    success:function(data, textStatus, jqXHR)
    {
        if (data.length) {
            console.log(data);
this is in lib.js
data basically returns the code behind index.php
 
That doesn't make sense.
Do you have a routing thing?
.htaccess mod_rewrite, nginx?
 
4:29 PM
No
I do have .htaccess, but that doesn't affect the url much here
 
If you try to access ../front/tools/u.search.php manually, what do you get?
 
404
shoot
 
Notice that it needs to be relative to the page
so for instance if you're doing the search on http://example.com/foo/bar try to access http://example.com/foo/bar/../front/tools/u.search.php
 
0
Q: How do I increase the width and font-size of my twitter feed widget?

SkullomaniaI have created a pure JS twitter feed widget, however, I cannot figure out how to increase the width of the feed to 960 pixels and bump up the font size. I have done a couple of google searches which suggested of adding some css to target and increase the size of the iframe #twitter-widget-0{wi...

 
This no longer makes sense, especially since this was working in the dev server. Now on production, it broke.
 
4:32 PM
@Skullomania You asked the question less than a minute ago
Please have patience before dumping your question here like that...
 
I wanted to see if you guys had any ideas
I was going to ask it here first
 
@SecondRikudo Wrote a wrong url, that's why go 404. When I browse to that URL, I get a Notice: Undefined index: val in
 
noone was around
 
!!welcome Skullomania
 
@Skullmania Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
4:33 PM
So many hats, which do I choose!
 
@Skullomania Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
?
makes no sense
 
@DemCodeLines And when you send a POST request manually to that page with the val present?
 
good morning lovers
 
@SecondRikudo I changed the post to a get and I get a blank page
But on index.php, I continue to get a copy of index.php embedded inside the main one.
 
4:43 PM
@SecondRikudo stop bothering... the guy is making an xhr request to /
 
@FlorianMargaine That's not what his code says...
 
that's what his behavior says
 
Hello guys! Do you know if I can post questions here?
 
!!welcome FlerexFerwin
 
@FlerexFerwin Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
4:44 PM
@Zirak @rlemon why no welcome?? ^^
 
Thanks ^^ It's my first time here
 
Go ahead and ask.
 
Ehm... So I cannot post anything here. I don't know what SO means btw.
 
@FlerexFerwin SO = Stack Overflow
 
Aaaaah. I'm dumb.
 
4:47 PM
 
That's the point. I've doubts if it would be an appropriated question for SO.
 
@rlemon Your point?
2 mins ago, by Second Rikudo
Go ahead and ask.
 
hello
 
Well. I've checked some tutorials of OOP Javascript but I cannot think in a way to use it. People says that it's the best way to program but I cannot think in a way to translate my scripts into OOP.
 
I just follow SOC everywhere.
 
4:51 PM
it's usually spelled "SoC"
@FlerexFerwin uuuh how do you write your scripts today?
 
@FlorianMargaine SEPARATION OF CONCERNS!
 
@FlorianMargaine I am UnUsUaL.
 
I don't know, I'm not an expert. I write them in the common way people teaches it.
 
which is?
 
i am studying compilers by studying pascal
I have no clue why.
 
4:52 PM
any ~50 lines example you might share?
 
Sure, let me find anyone.
 
@FlerexFerwin Sample of code which you wrote in a fiddle would be good. Show us a short code snippet that you wrote, and you are proud of it.
 
... and expect it to be destroyed
 
completely
 
4:54 PM
If it's worth mentioning, index.php does have its url rewritten via htaccess.
Again, it was working fine.
 
I'm not proud of everything haha jsfiddle.net/bpsjo2hj
anything*
 
@rlemon the animation looks pretty cool... other than that the only difference from a normal depth first generator is that some cells are already marked as visited I guess... let me read
 
read the article
 
@FlerexFerwin you're already using objects
 
Well. So I don't have a clue what i'm doing
 
4:56 PM
and I've seen worse code than yours
every time you use the dot, you're calling a property on an object
hmmm you need some js intro I guess...
 
Not that I understand the variable names, but the code looks ok..
 
@FlerexFerwin have a look at JavaScript: The Good Parts
 
oh, the guy does it in a slightly different way...
 
I'm weird, I know. ahah
 
first makes the maze, then removes some corridors until it gets to a fixed amount of them, then he tries to generate the rooms...
 
I thought OOP way to program was using variables and creating obejcts
 
@towc the idea behind showing these is that they do more than just 'here is the theory' - here is someones application of the theory. you might pick up some tips and tricks you didn't know before.
 
I would have started with a finite amount of rooms
 
Brilliant
 
Thanks guys. ^^
 
oh, his second way of doing it is actually my first way...
 
!!mdn re-introduction to javascript
 
4:59 PM
@FlerexFerwin ^
 

« first day (1528 days earlier)      last day (3434 days later) »