« first day (1521 days earlier)      last day (3428 days later) » 

9:00 PM
@JiFus no .. it just means that you cannot code in PHP either
 
Well
In php I can say: if ($var != 1 || 2) { ... without a problem
 
lol
 
@tereško In that case, they don't need jQuery
 
@SomeKittens weeeeeeeeeell. There are deadlines and shit/
 
@JiFus that code, it doesn't do what you think it does
 
9:01 PM
@SomeKittens oh yeah I remember starring that
 
!=============
 
Well normally it gives me the expected result
 
No it doesn't !
 
@BenjaminGruenbaum Yep, making solid progress at the expense of SPACESHIPS
 
So can you explain what I'm doing wrong then ?
 
9:02 PM
@JiFus that reduces to if (true)
 
you're getting true every time, for starters
if (false || true)
true
 
@JiFus Let's add some parens: if ( ($("#test").val() != "1") || ("2")) {
 
!!> (true || false || maybe)
 
@Jonathan true
 
win
 
9:03 PM
also, the logical expansion (what you think it does): if ($var != 1 || $var != 2) <-- is also always true
 
fuck
ok well the timers are all fucked. :(
I gotta run
 
Then why @ircmaxell?
 
will fix asap
!!afk
 
why what?
 
Why will it always return true
I only want the statement to return true if $var is not equal to either 1 or 2
So if it's empty actually
 
9:05 PM
@ircmaxell well, if it's a getter...
 
if (a !== 1 && a !== 2)
 
Sorry, I'm just so used to challenges of 'make this work'
 
We don't send teh codez here ( just a reminder )
 
Ah I see
 
@NickDugger now that's just a syntax error.
 
9:05 PM
oops
 
@BenjaminGruenbaum you be quiet you
 
fixed
wait
 
@ircmaxell what's up by the way? Haven't seen you around here in a bit and I have been less active in the php room.
 
there
 
not much, slowly recovering from pneumonia
 
9:06 PM
But maxell could you help me out?
 
@ircmaxell Ouch, no fun. Try not to get dead.
 
did you not read what I said, @JiFus?
 
@JiFus You've been given enormous amounts of help.
 
If I would say: if (var != a && var != b) it's okay ?
 
1 min ago, by Nick Dugger
if (a !== 1 && a !== 2)
notice the !== and the &&
 
9:07 PM
Because for some reason that doesn't work either :P
Really I don't know why
 
@ircmaxell oh that's shitty, I had pneumonia a few years ago. Not very fun.
 
explain what you're trying to do
 
^
 
9:07 PM
But I have: if ( $("#test").val() !== 1 && $("#test").val() !== 2) {
 
@BenjaminGruenbaum yeah, been 2 weeks so far. fever's gone, but still caughing and general lack of energy
 
I had Pneumonia, strep, and the flu at the same time when I was in 8th grade. I was in the hospital for like a week and a half
 
And it always returns true
 
@JiFus what is the value of $("#test").val()?
 
@JiFus $.val() returns a string and not an integer
 
9:08 PM
@JiFus let's try this step by step ok? console.log($("#test").val()) what is it?
 
my guess is it's not an integer
 
Don't tell him the solution right away everyone :/
 
great minds think alike
but fools rarely differ, so...
5
 
yay I got it
maxell was right, it returns a string not an integer
 
9:09 PM
lol
 
@ircmaxell oh so you also think all the world's problems are because of jQuery?
 
So '1' and '2'
 
@JiFus in javascript, we have == and ===. Avoid == if you can. Convert your types if you can, before comparing.
makes more sense that way
 
@BenjaminGruenbaum not all, but yes, many
 
!!> Number("123")
 
9:10 PM
@NickDugger 123
 
Okay, thanks @NickDugger I will
 
@ircmaxell That was a racist joke initially, it was the Jews, then it was a nationalist joke and it was Israel - those were funnier but then I figured people would still not get it's a joke so meh. Humor-- thanks political correctness.
 
Thanks guys, I'll be gone now
Before I upset any of you (I think I have already)
 
@BenjaminGruenbaum Where'd the joke go?
 
Nah, we just forget what it's like to not know things, sometimes
 
9:12 PM
@SomeKittens it was jQuery.
 
uh oh my foots asleep
 
@BenjaminGruenbaum That was quite weak
 
@Zirak thank you.
@JiFus you're not upsetting us - it's just frustrating since you learn very little from getting answers without knowing how to get them next time.
 
do you wanna build a snow man?
 
9:13 PM
Get into the office at 7:30 before everyone else to get some shit done, and the internet's down.
 
@monners that's brutal D:
 
FML
 
Wait how are you here?
Mobile?
 
That's when I get in every morning, well more like 7:00 these days
 
Just got the backup line up and running
Not sure how long it's going to hold out. Support says it's not fixed yet
 
9:15 PM
I knocked my phone off the charger last night and my phone died and my alarm didn't go off so I was in at 11:30 today
 
And I can't work until I can pull on a massive repo
 
But I worked through lunch and was productive so bossman is ok
 
I get to go home in a few minutes. I wanna work more on a personal project of mine.
 
Bloody ABN bank
They have a CSV format but they put all the data you'd need in the comment column. Even worse, they do it so it's impossible to extract -.-
Do we have a rant channel or can I vent here? -.-
 
9:30 PM
@Jonathan Rant channel
 
@PeeHaa Thanks :)
 
;-)
 
@PeeHaa I've actually spoken with their tech support about this and they fully agreed. But at that time I was just thinking they we're making my life miserable. Now I've realised they made what I want impossible.
 
@Zirak If I could add my own methods to CommandLineAPIImpl w/o having to write and install an extension, that would be great.
 
@Jonathan Don't they supply some APi?
 
9:34 PM
@ŠimeVidas what do you want to do exactly?
 
@PeeHaa not that I know of, I just know their online banking site is horrible at best.
 
@FlorianMargaine Define a foo function that is available in DevTools console permanently, on any page.
(Add my custom helper function.)
 
Doesn't even render correct in Chrome
 
@BenjaminGruenbaum man that component file thing is soooooo much awesome I used it at one more place and it streamlined so much work for me! thank you x10k :D
 
@ŠimeVidas you can do that with an extension
 
9:36 PM
@AwalGarg sure thing, glad I could help.
 
IT WAS A FLIPPING OBJECT REFERENCE PROBLEM
RAARRGH
!!afk lunch
 
always is
 
SOMEKITTENS SMASH
 
@ŠimeVidas extensions indeed like @FlorianMargaine says, it's very easy.
 
@Jonathan Yeah that shit is pretty fucking horrible. And the worst part is they keep changing it every x months just for kicks
 
9:37 PM
sup guys?
 
@FlorianMargaine @Jonathan Ok. But I would prefer if this was available out of the box.
 
it is. Through an extension.
or you can run snippets
 
@BenjaminGruenbaum with a lil bit of playing, I had it optionally render multiple components at once, like google serves css for web fonts, which allows me to test if different components go well together.
 
@PeeHaa I personally use ING which has the best imo and SNS which isn't terrible even though they don't seem to have it that long
 
I think there are also extension that let you have snippets that are immediately run
 
9:38 PM
@ŠimeVidas DevTools has a lot to offer out of the box
 
@AwalGarg If you want to build big things you might want to consider the ability to compose components (that is have a component inside a component) - that way having multiple components is just a special case of that.
 
@FlorianMargaine you just load any piece of JavaScript named *.user.js as extension
 
@ŠimeVidas Florian is right, you can't
 
@Jonathan Yeah my private account is also with the ING. It's decent
 
I use it when colleagues go to the bathroom to have certain sites randomly change color everytime they visit them...
 
9:40 PM
nobody has anything up somewhere?
 
@Jonathan DevTools is great but I would like if the JS code it’s based on, was hackable w/o having to use extensions.
 
What do you mean?
 
Let me add CommandLineAPIImpl.prototype.myThing dammit :)
 
@BenjaminGruenbaum I didn't get that... example?
 
@AwalGarg Example: you have a "news ticker" component and you want another component to use it.
 
9:43 PM
Imagine if you couldn’t extend jQuery with plugins without installing an extension. How stupid would that be.
 
@ŠimeVidas extensions is a good option imo
 
@BenjaminGruenbaum ahh. Right, right. So instead of rendering the entire page, the script would have to only render that particular component with it's css and js, so that the other component can use it as well, correct?
 
@Jonathan Good but not great.
 
@AwalGarg yes.
Although I'm not sure it's worth your time if your abstraction is already good enough - more abstraction comes at a cost.
 
hmm, would be a cool thing to have actually. And would be easy to to implement as well.
 
9:46 PM
The fancy name is "the composite pattern" or modular design.
 
@BenjaminGruenbaum I am happy with what I have for now, but I wanna see where I can take this, so I am definitely gonna give it a try.
 
Cool, good luck.
 
thanks :)
!!afk good night, in real
 
Hello =]
Sounds like a fun meeting you had last time
 
My coworker just sent me the best rage gif
 
9:57 PM
https://www.google.nl/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=office+rage&safe=off&tbm=vid
First two are nice
First is terrible actually -.-
But my hat does get bigger if I type more lines!
 
if you create a date object by specifying a specific date (i.e. new Date(//some date)) instead of using current date (new Date()), then the functions getUTCDay() and getDay() will return the same value, correct?
 
@ray9209 Did you try? Read what both functions do? Look at their names maybe?
 
rlemons-12-days.herokuapp.com (ping me if it breaks, it's not fully tested)
 
Also ping me if login breaks
@SomeKittens Login broke.
@rlemon I broke it
 
10:05 PM
lol how?
 
it's broken for me too
 
yeah I broke it too
 
hanging on auth response
 
kendall did actually
 
10:06 PM
failed to obtain access token (status: 400 data: {
  "error" : "invalid_grant",
  "error_description" : "Code was already redeemed."
})
2
 
well, login is broken
 
yeah
 
fuck
:(
 
@rlemon login with google hangs
 
yes, you're the 5th one to report it :D
 
10:06 PM
I gotta go soon
work Christmas dinner
 
error message, not sure if anything sensitive so deleted
 
it's ok
 
@rlemon Login is broken
 
> Code was already redeemed.
 
@rlemon you don't have to fix it now, I unpinned/unstarred it in the mean time
 
10:08 PM
@rlemon mind if I look into it?
 
@SomeKittens is that the tutorial video on ES6 promies?
 
at /app/node_modules/passport-google-oauth/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth2.js:125:38
 
at process._tickCallback (node.js:419:13)
 
Looks like it's a bug in something called "node"?
 
10:09 PM
@SomeKittens go ahead
 
yeah, who uses that
 
> Tom you gotta come out of the closet oh my god - John Travolta
 
I thought io.js was all the rage
 
@SomeKittens code is TERRIBLE
:P I rushed it pretty bad
I will clean it up tomorrow
ohhhhhhhhhh
wait..
 
10:11 PM
Yay first 200 answer.
 
lemonnnnn
 
passport.deserializeUser(function(obj, done) {
  done(null, obj);
});
 
partyyyyyy
 
@SomeKittens shouldn't this be doing other things
 
@BenjaminGruenbaum wow congrats!
 
10:12 PM
@rlemon lol :D
 
grats @BenjaminGruenbaum
 
replace("\s+"," ") will that remove excess whitespace?
 
@BenjaminGruenbaum ?
 
@FlorianMargaine his ajax answer
 
@BenjaminGruenbaum link? so i can downvote
 
10:13 PM
It's totes popular
 
ah
there's no badge for 200 though, is there?
 
Nope, but I got one today for the setImmediate vs nextTick question
I should have Q&A'd that :P
 
that was placeholder...
 
that is a very good answer
 
10:17 PM
@SomeKittens what should he do?
 
might have fixed it?
i'm going to have to kill the players db
1 sec
nope
it's dead
@SomeKittens well i have to go out to dinner now
 
Sorry
 
if you are bored and wanna fix the login, be my guest. otherwise, i'll fix it when i get in
!!afk dinner, will fix 12days when i get back in.
 
10:27 PM
Can anyone tell how I capture the field after "Name: " until I find 2 spaces? var reName = /Naam:\s*(\ +)/; <- doesn't work
...or point me to a decent regex tutorial o.0
 
Practice makes perfect
 
@Jonathan Are you sure you need a regex, rather than just string search (indexOf)?
 
@Jonathan By the way, \s matches whitespace, so that looks pretty wrong
 
@SomeKittens Classic
 
10:30 PM
So this: /Naam:\s*(\s\s+)/
 
@Jonathan Also, Naam is not how you spell Name
 
@Zirak it is in dutch ;)
 
@Jonathan If you're looking for spaces, you're all set, but you're not going to find much else
 
Well the basterds have spaces in the namefield which is delimeted with spaces
so my best bet is looking for 2, hoping it's not one, otherwise I'll get everthing after it as well
 
Or you can just look for two
 
10:33 PM
oops, I'm capturing 2 spaces now
 
So we're all just starring everything to get the hats then?
 
I never accept payment in hat form
 
Just star everything in the star list.
 
I'm not seeing any hats
Guess I need to log out or something to see em
 
How do I capture "anything untill matched" in regex?
I want to capture single whitespace chars but stop when I find 2
 
10:38 PM
How did that ever get 3 stars?
 
Got it: /Naam:\s*(.+)\s\s/
 
!!riot
 
╯°□°)╯┻━┻
 
"It's trivial to copy to clipboard using on JavaScript"
 
sorry, window.prompt ->
http://stackoverflow.com/a/6055620/2407212
709 votes Yeah baby
 
10:47 PM
Yeeeep
 
What's the best javascript book you can recommend?
 
The Art of War, Sun Tzu. Divide and conquer. Nah, no idea
 
LaVey's Satanic Bible
 
@DemCodeLines Can't go wrong with free: eloquentjavascript.net
2
 
Animal Farm
 
10:50 PM
Oh wait, were we all giving joke answers? I missed the memo.
 
I really don't like online books.
Maybe it's just me, but I learn much better reading actual books than some article online.
 
JavaScript: The Good Parts - Douglas Crockford
 
window.print
 
@DemCodeLines best book overall, or best book for you right now?
 
How about both?
 
10:51 PM
@DemCodeLines JavaScript: The Good Parts - Douglas Crockford
Read it. Then read it again. Then work for a year. Then reread it.
I'm not seeing any hats
 
Anyone wants to point out how to catch the part after /IBAN/? regex101.com/r/bR9jV0/1
 
@monners Anything special about that book?
 
Yeah, it's more or less the bible for fundamentals :braces for outcry:
Plus Crockford's a pretty good teacher
 
and he doesn't use for loops
 
He can be a bit, pedantic
 
10:57 PM
Yep, but he's right more often than not about the things that actually matter.
 
JSLint whining about redeclaring i in a for loop is just annoying imo
 
Take the opinionated/stylistic stuff with a grain of salt
(function() {
    var i = 0;
    for (;i < x; i += 1) { ... }
}());
No more variable leakage
 
!! for (var i= 0; i < x; i ++) OR for (;i < x; i += 1)
 
@Jonathan for (;i < x; i += 1)
 
bitch
 
11:01 PM
Should probably pass the dependencies into that example as well...
 
I've never actually gotten around to reading The Good Parts.
 
(function(x) {
    var i = 0;
    for (;i < x; i += 1) { ... }
})(num); // Dog's balls!
 
Closure hater?
 
Nope, quite the oppposite
 
Then why inject num into that function?
 
11:15 PM
Best practice / convention:
indexOf(foo) > -1
indexOf(foo) != -1
?
 
If you work on your own code, it doesn't matter. If you work on other people's code, do it the same way they do
 
Yeah, how should they do it? :P
 
good evening
 
Choose any way and then stay consistent
 
!!welcome @qd0r
 
11:18 PM
@@qd0r 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.
 
@Jonathan .contains(foo)
 
@CapricaSix dont worry
 
@Jonathan @ is automatically added
 
@BenjaminGruenbaum good point...
 
11:18 PM
!!> [1,3,5].contains(3)
 
Java is number 2...
 
@Retsam That didn't make much sense. Use the !!/help command to learn more.
@Retsam "TypeError: [1, 3, 5].contains is not a function"
 
It's ES6 so polyfill it.
!!> Array.prototype.contains = function(x){ return this.some(y => y === x); }; [1,2,3].contains(3);
 
@BenjaminGruenbaum true
 
!!> Array.prototype.contains = function(x){ return this.some(y => y === x); }; [1,2,3].contains(-2);
 
11:20 PM
@BenjaminGruenbaum false
 
Now in a better language that'd just be:
 
contains = any compose some compose eq
Or something like that.
 
!!> if (true) console.log("true");
 
i have an API running on my server. i integrated an autocomplete textbox on his website. for that reason i had to add the HTTP header Access-Contol-Allow-Origin to *
now i want to avoid that other people can use my API.
 
11:22 PM
@DemCodeLines "undefined" Logged: "true"
 
@SomeKittens saw that. What'd you think about it?
 
i've seen the following example: stackoverflow.com/a/7454204/1816900 there the HTTP_ORIGIN property will be readed from the request. is it save?
 
Router sounds cool.
 
@BenjaminGruenbaum Neat stuff all around, seems like a simple upgrade
 
Yeah, it's good to see work on 1.x
 
11:24 PM
@BenjaminGruenbaum That's gonna keep happening past 2.0 though surely
 
@phenomnomnominal probably not new work as in new features.
 
i mean the ajax request is executed by an user agent. does all browsers send this HTTP_ORIGIN property?
 
This ABN Bank is really pissing me of now :(
 
"Make Batarang useful again" sadly absent.
 
@BenjaminGruenbaum maybe not by the angular core team, I'm hoping the community will keep working on it
 
11:25 PM
@phenomnomnominal No perf stats
 
@SomeKittens yeah, but better than nothing
batarang is just straight broked
 
Yeah batarang is pretty useless
 
11:43 PM
Damm, 0:45 already
 
@rlemon make a JS chat hat in PS and we'll all wear it
 
@BenjaminGruenbaum rlemon is afk: dinner, will fix 12days when i get back in.
 
cc @mikedidthis
 
Goodnight
 

« first day (1521 days earlier)      last day (3428 days later) »