« first day (1669 days earlier)      last day (3289 days later) » 

12:03 AM
@Zirak commented
since you left me out
 
@SomeKittens It's nothing personal, just that no one likes you.
 
I know, I know
 
What a minute, that is personal!
 
GJDOIJOGIDSFJGOPIJ!!!!!!!! I NEED TO GET OFF MY QUESTION BAN!!!!!!!!
 
@SterlingSilver 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.
 
12:07 AM
@SterlingSilver You're not doing a very good job of it with that introduction
 
user1596138
12:22 AM
My new place and job and stuff may be cool. But I'm still broke till next Friday and I have no friends :O
 
12:37 AM
1 message moved to Trash
 
@Zirak there's VisualStudioCore for windows linux and mac
 
how would I 'stache' a promise to resolve or reject later on?
 
stash?
or are you adding facial hair to a promise?
 
@Jhawins haha yeah man id hang out more but with my mom coming we're annoyingly busy
 
@SomeKittens yes
 
user1596138
12:52 AM
@Loktar Haha yeah man it's cool no worries. You got me the job you don't have to take care of me too ;P
 
haha
@rlemon beard.io ofc
 
user1596138
I'll have to make friends anyway lol. Funny how I'm so young relatively at work
 
user1596138
I wonder what people my age do here lol
 
farm
 
user1596138
I... Don't think so
 
12:55 AM
@rlemon You can stick it in a variable and .then off of it later
 
@SomeKittens I am trying and am getting 'unhandled rejection typeerror'
 
user1596138
@Loktar we should go to that arcade when I'm 21 lol
 
@rlemon codez?
 
lemmy try to simplify it a bit
 
user1596138
@SomeKittens I didn't see this message. "Software Engineer"
 
12:59 AM
@Jhawins oh, cool
 
user1596138
What's your?
 
Same
sorta
"Frontend Engineer" would be more accurate
 
user1596138
I'm a front end engineer but my title on the offer was "software engineer"
 
Yeah, same here
 
mrc
I'm trying to learn three.js, and am curious: why is it designed so that transformations are applied in a specific order (scale, rotate, translate) instead of the order in which they appear in code
 
1:02 AM
@mrc 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.
 
user1596138
Sounds nicer to normals, ambiguous to devs.
 
@rlemon I've got to head out, ping me anyway, will pick up when I get home
 
hello from Kyrgystan
 
user1596138
@KendallFrey wut
 
user1596138
you go on the trip?
 
1:05 AM
I did
 
user1596138
Nice pic plz
 
@SomeKittens well its on runnable now
 
that's what I got from my terrible phone camera
 
but without publishing to public I can't share can i?
 
1:08 AM
taken diagonally to get as much of that massive thing on
 
@SomeKittens do you know anyone from GH?
Ooh, @IonicăBizău are you here?
 
@BenjaminGruenbaum got a minute? kittens is afk and I have promise questions
 
Sure, but I need GH help, for some reason they decided I am a robot
 
well, question. really I just need someone to point me to the right place in the docs and i'll probably be fine
it crashes ofc.
I just wanna 'save' a promise for later so I can resolve it with the next input
 
user1596138
@KendallFrey Cool!
 
1:13 AM
laptop's dying, bye
 
> Sorry, but the page you are trying to view does not exist.
@rlemon
 
can you see this and run it?
I published it
:/ not sure what else to do
 
user1596138
@rlemon yes.
 
user1596138
You can't send the output page.
 
cool. I know the rest of the code is a mess, it is a WIP.
just trying to get it working and understand it before I polish it up
so radical changes to make this 'promise resolved on next command' I could consider.
 
user1596138
1:15 AM
It seems to run a separate instance for each "runner". I.e. my chat server runnable doesn't allow other users to connect to the same instance
 
because that will be an important feature to 'prompt' users.
 
My GH is banned and I need to talk to them :D
 
did you email them?
tweet them?
carrier pigeon?
 
I used the contact form
 
user1596138
@BenjaminGruenbaum it's only your public profile...?
 
user1596138
1:18 AM
Continue working with your repositories and wait for support? :P
 
@Jhawins no, it's every issue and every comment I created.
Like, things that are discussed right now disappeared in the middle of discussion in io.js
 
you pissed off the wrong person?
 
No, I replied on @Zirak's gist thing and it picked that up as an advertisement for WebStorm
 
user1596138
Ha! Wow that sucks, good luck.
 
user2620028
Well i just re-took my final that crashed on me the other day
 
user2620028
1:23 AM
and it crashed again
 
so.. uhh.. @Jhawins you umm got an idea about my promise conundrum?
#vamp
 
user2620028
Turns out if you use the mouse wheel to scroll in the final exam it crashes it and you cant submit it and you get a 0
 
I can help you as soon as my GH issue is fixed :/
 
user1596138
@rlemon I guess I could look at it after my pizza
 
on .prompt I'm trying to 'save' a promise to use in the next data input
 
user1596138
1:26 AM
@rlemon `Unhandled rejection TypeError: Cannot call method 'call' of undefined
at /root/commandliner.js:88:28 `
 
yes, I saw smart ass :P what am I doing wrong
dammit
 
user1596138
That's the problem?? Ohh. Shit idk probably the then
 
fuck off . don't talk to me. :hides:
(I found the problem, scope issue, I'm stupid)
 
user1596138
xD
 
var that = this; done
:D
 
user1596138
1:28 AM
I said after my pizza
 
> git commit -m "Finished alpha"
[master a4d210b] Finished alpha
19 files changed, 1337 insertions(+), 217 deletions(-)
create mode 100644 src/js/components/Tracker.jsx
such insertions !
 
1:49 AM
is there a better way to do this ^ ??
 
@rlemon msgs = Array.isArray(msgs) ? msgs : [msgs]; you can just do msgs = Array.from(msgs)
 
@Jhawins yeah for sure
 
neat, but not what I was wondering about :P
 
that beercade sounds badass
I might head there with the wife memorial day weekend for a night
 
beercade?
I'm fucking in!!
 
2:00 AM
My GH is broken, while io.js people kindly fix it, I'm gonna write that promise answer I've been meaning to for ages on the big async question
 
@BenjaminGruenbaum how about reading the comments at the bottom of this if you wanna answer a promise Q jsfiddle.net/m7m9d32j/2
;) :D
cc @SomeKittens who I see is now online again :D
 
@BenjaminGruenbaum Hey, yes! I just woke up.
 
do you know any GH people @IonicăBizău
 
@BenjaminGruenbaum You mean from staff?
 
They think my account is a robot -_-
So they muted it, and I need them to re-enable it
 
2:09 AM
Oh, just write them: github.com/c
The will give you a fast feedback.
But what did you do?
 
49 mins ago, by Benjamin Gruenbaum
No, I replied on @Zirak's gist thing and it picked that up as an advertisement for WebStorm
2 hours ago, by Zirak
I made a thing: https://gist.github.com/Zirak/9999e97e01a7bd0a76f6 (list of editors). Please add stuff.
 
Got it, you should write to support and they will solve the issue, don't worry.
 
> Need help with jeffbcross/http-design?

You should get in contact with @jeffbcross. You could open an issue.
that's an odd plug
 
@SomeKittens where?
 
@BenjaminGruenbaum On github.com/c
they must have noticed I was looking at the project
 
2:13 AM
@BenjaminGruenbaum BTW, you saw this?
 
Oh, odd, lol
 
@SomeKittens Yeah, if you come from a repo, they detect that.
 
0
A: How to return the response from an asynchronous call?

Benjamin GruenbaumIf you're using promises, this answer is for you. Your code should be something along the lines of this: function foo() { var data; // or $.get(...).then, or request(...).then, or query(...).then fetch("/echo/json").then(function(response){ data = response.json(); }); ...

2
There were just too many promise questions with that issue and my old answer didn't address that at all.
 
Hi everybody using nodejs, expressJS, how can I use req, res and next from a module? thanks
 
@MelgoV 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.
 
2:26 AM
Ok I'll read it thank you
 
@MelgoV like, making your own middleware?
 
Yes
Sorry my english is too bad but I hope you understand me
I am writing a Module for my app policies
One of my policies is when the user is not autenticated return to login view
this is what I have
`exports.isAuthenticated_r12 =function(req, res, next){
console.log('it works!');
if(req.isAuthenticated()){
next();
}
res.redirect('/#login');
};`
 
...can you redirect to an id?
anyway, you need to either return early (and skip line 6) or add an else clause
exports.isAuthenticated_r12 = function(req, res, next) {
  console.log('it works!');
  if (req.isAuthenticated()) {
    // No one cares about the return value, we're just using it to exit early
    return next();
  }
  res.redirect('/#login');
};

exports.isAuthenticated_r12 = function(req, res, next) {
  console.log('it works!');
  if (req.isAuthenticated()) {
    next();
  } else {
    res.redirect('/#login');
  }
};
^ one of those two
 
Sorry for my formatting code
Ok
 
@rlemon ok I'mdone with the answer what was your issue?
 
2:33 AM
basically I wanna get this.
> press a
I press a key
> press b
I press a key
> console log output.
this is the best I could come up with right now.
 
function foo(msgs) {
    return new Promise(function (resolve, reject) {
        msgs = Array.isArray(msgs) ? msgs : [msgs];
        msgs = msgs.map(bar);
        resolve(Promise.all(msgs));
    });
}
 
I'm looking for some guidance.
 
Is this just a return Promise.map(msgs, bar) ?
 
Nop my question was about, how use req, res and next from a module where I don't have access to them?
 
@BenjaminGruenbaum possibly. I'll look at the promise.map docs. thanks.
 
2:35 AM
You want a queue of keys?
That is, you want a promise for the first time a key is pressed?
Oh, I think I get it
 
no, when the function is called.
I'm writing the command line tool
 
You want to show messages until a user presses a specific key?
 
- Display a message
// get feedback
- Display a second message
// get second feedback
// Display data about both feedbacks
 
Oh, ok, I can do dis, gimme a minute
 
so foo(['enter username', 'enter password']).then(function(data) {
  // user entered a and b, now do shit.
});
this is what I'm after.
 
2:37 AM
gimme a minute
 
ty, much appreciated.
 
There we go
Although if you actually read stackoverflow.com/questions/14220321/… I think you would have gotten it on your own, maybe, kinda, ish
 
coulda linked it first ;)
but I got it. I saw join, and then saw all and thought it would be easier.
 
I did, someone even pinned it
 
@BenjaminGruenbaum ohh, I wasn't looking then :D
now, follow up question because I'm drunk and i'm not sure if it is easy. what If I have a variable amount of inputs?
 
2:45 AM
Then chain the promises in a for loop
Or use Promise.each
 
> chain the promises in a for loop
can you give me a quick example?
wait. I might be able to figure this out.
 
glarble glarble who seen me marble?
 
// lol hax
I used that today
on a short circuit eval.
 
user1596138
2:54 AM
@BenjaminGruenbaum you got another way you would write that?
 
which part? Assuming display isn't really there it's not long
@rlemon In my own code I'd just let or use a for of or forEach
Who am I kidding, in my code that'd have been a reduce but that'd just be confusing
 
user1596138
The way pw is
 
yea i'm drunk and I still haven't been able to figure it out. but i'm going to make another drink and try again. if you are on for much longer you might be able to help if I rage quit.
 
user1596138
I'm just curious. I don't like the way it looks so
 
user1596138
Nvm I was confused. That's cool
 
3:02 AM
well I have the questions coming in order
but I get undefined for the outputs
:back to work:
omg I got it!
@BenjaminGruenbaum :drunk-hugs:
 
Cheers bro :)
Now actually read my answer about async with promises and gimme feedback kthanxbye
!!afk fu caprica
 
@BenjaminGruenbaum Of course not
 
user1596138
!!sleep wut..?
 
@Jhawins That didn't make much sense. Maybe you meant: deep, slap
 
user1596138
...
 
user1596138
3:09 AM
Human intervention I smell
 
!!sleep should
 
@rlemon Frankly my dear, I don't give a dean
 
user1596138
It smells like alcohol
 
should is a trigger
 
user1596138
Ugh
 
3:12 AM
can anyone help me with javascript issue?
 
@Steve you should know better by now
 
know what?
issue i'm having im trying to get video links from javascript sample code document.getElementById("id").src="LINK"; the code is working fine if i just have one time on page but if i was to use same code for multiple videos with different id's then for some reason its not gettings sources
 
!!welcome Steve
 
@Steve 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.
 
@SomeKittens that's what you meant sorry
do you happen to know the issue?
 
3:20 AM
> obj = {};
{}
> obj.for = "hello"; //said to give off syntax error because 'for' is reserved

But in my node interpreter it works fine. What gives?
 
user1596138
!!> var d = {}; d.for = "hellodare";
 
@Jhawins "ReferenceError: assignment to undeclared variable d"
@Jhawins "hellodare"
 
@ApathyBear object properties aren't reserved
 
@Steve is there any other way you could identify the videos? do they have <video> tags or is there a class name..?
 
Hm, looks like this this MDN page is incorrect.
I would show you guys, but no page hooks (lol)
 
3:26 AM
@ApathyBear why would you try to use a reserved keyword anyways?
 
@ApathyBear page hooks?
 
@nick the label property, those promise error handling methods...
 
@nick it's in <video> however i'm using flashhls with videojs flashls.org/videojs/flash_demo.html due to some restriction it doesnt let me use shortlinks so except for editing each page to update the links i'm trying to use javascript instead
 
!!> (function () { 'use strict'; var d = {}; d.for = 'hai'; })()
 
@SomeKittens "undefined"
 
3:28 AM
@SomeKittens anchor *
Scroll down to Objects
 
Yup
looks like they wiffed
or V8 is flaunting the spec
 
It was illegal in ES3
not sure if it's allowed since ES5 or ES6
 
@Steve have you tried document.getElementsByTagName("video")?
 
@nick I was just reading the page and thought it was weird so I tried it, haha
 
@ApathyBear haha ok i thought you were legitimately wondering why your code wasn't working
except it was
 
user1596138
3:34 AM
9
A: using reserved words as property names, revisited

UIZEIn ECMAScript, starting from ES5, reserved words may be used as object property names "in the buff". This means that they don't need to be "clothed" in quotes when defining object literals, and they can be dereferenced (for accessing, assigning, and deleting) on objects without having to use squa...

 
Good to know, not that I would do that anyways.
 
@Jhawins nice
 
Just got a branch to review. 830 files changes. :(. See y'all in a week.
 
user1596138
@ApathyBear I mean there's no reason you couldn't. Spec says nothing against it
 
user1596138
But it isn't IE8 friendly lol.
 
3:45 AM
@Jhawins Word. I updated that MDN page with a note about ES5 and later.
 
user1596138
@ApathyBear Oh then here include the link in the spec es5.github.io/#x7.6.1
 
@ApathyBear ES5's been around for a long while and only now is that updated high-five
 
user1596138
> A reserved word is an IdentifierName that cannot be used as an Identifier
 
@Jhawins Thanks, good point.
@SomeKittens Look at me all posh
 
/me has never edited MDN
 
3:51 AM
Now give me a Tshirt Mozilla!
Lol.
 
Just go to one of their meetups?
 
@rlemon Haha, pretty sweet, isn't it?
@darkyen00 Haha, yeah, this October!
 
Who wants to be a rubber duck?
 
@SomeKittens me
anything other than this review
 
4:03 AM
I'm debugging a Chrome extension that adds a panel to devtools
 
I wanna be a rubber bear
 
The panel most certainly exists.
I added a console.log to the devtoolsBackground.js file where the panel is added
it does not log in either the main console or background console (different background file)
 
Ah, I need to open/close the devtools
 
4:05 AM
quack
 
I'll show you who is a quack..
 
@nick
you still here?
 
Ok, need real opinions here
 
@Steve ah yeah
 
We've got a hint module that does JSHint like stuff except for Angular. I'm trying to emit namespaced events (i.e. scope:new). I need to collect all hints from several namespaces (controllers, directives, etc)
I'm thinking if (['controllers', 'directives'].indexOf(message.module) > -1) {
can anyone do one better?
 
4:14 AM
regex?
 
i just saw your ping @nick okay so if was to just use document.getElementsByTagName("video") it will be just for once video i have like over 20 videos
that's why im trying to use ids
 
@Steve That query will return all video elements on the page
 
@Steve it'll return all the video elements in order of which they appear on the page
check this out, it shows you how to loop through: developer.mozilla.org/en-US/docs/Web/API/Element/…
 
I dream of a day when webforms no longer exists
 
so it will be like <video id="id" and rest of video tag code right?
 
4:28 AM
@Steve hm?
 
sorry im still trying to learn
is it possible if u can make fiddle?
 
i would but i have to go in a minute
bottom line is: if you have <video> elements in your html
you will be able to get all of these objects using javascript
by document.getElementsByTagName("video")
 
document.querySelectorAll('video');
 
aaaand Git saves my rear again!
 
and you will have to loop through and change whatever properties
stuff like that
 
4:33 AM
@nick is it like same concept for all of the other video players like videojs, popcornjs flowplayer and so on
 
@SomeKittens how so? Git usually screws me somehow.
 
There were two methods, message and log. I merged 'em into emit
turns out they meant different things down the line
I was able to check history to find out what was what
 
[].slice.call(document.querySelectorAll('video')).map(function(current, index, arr) {...}););
 
4:48 AM
Now you're just gonna confuse him :p
 
much cleaner than $('video')
 
Nothing is better than jquery
 
I've been on an anti-jquery binge recently. Sure there are ugly bits like the above, but vanilla is so much more satisfying to write.
 
Because it's harder?
 
Oh I agree 100%
I was just joking
I can't stand jquery
 
4:51 AM
@JanDvorak Because it's more declarative
@Meredith Yeah, got that
 
I just don't like how many functions are overloaded
 
Array.from(document.querySelectorAll('video')).map(=>...)
 
Nice
 
@monners will u be able 2 make a fiddle?
 
I didn't know about Array.from
That's a cool new thing
 
4:55 AM
Creates a new array from any array-like or iterable object
Very useful
 
I'm surprised it wasn't added sooner
 
What, [].slice.call() isn't readable enough for ya? :P
 
I prefer typing out Array.prototype.slice.call()
It helps me practice my typing
 

« first day (1669 days earlier)      last day (3289 days later) »