« first day (2247 days earlier)      last day (2701 days later) » 
00:00 - 22:0022:00 - 00:00

Anonymous
10:55 PM
@PeeHaa yo
 
yo
 
Anonymous
I'm right in saying it's the OAuth API i'm supposed to be using for this, yeah?
 
yes
 
Anonymous
right, okie. thank you
 
np
 
Anonymous
11:10 PM
this documentation is utter ball bags
 
Anonymous
but from what I can tell, this is what we have to use
 
Anonymous
no, no it isn't
 
Anonymous
bare with.
 
I think you can use basic auth.
oonce that is working we can look into using a token
 
Anonymous
11:14 PM
> once that is working
 
Trying setting this header when building the request:
Authorization: Basic " . base64_encode("$username:$password")
This is how you can build the request github.com/amphp/artax/blob/master/examples/…
And here an example of setting the correct header github.com/amphp/artax/blob/master/examples/…
It looks like artax also supports auth in the uri
So https://username:password@github.com/api/url
I could try to make a gist to see how to make the call if you need
 
Anonymous
just trying to sort a few other exceptions so I can test :P
 
ah :)
 
Anonymous
getParameter... should return a string right?
 
yes
 
Anonymous
11:25 PM
xD
 
Anonymous
i seem to be getting a generator back from it
 
Anonymous
oh wait a min
 
Code?
:P
 
Anonymous
 
Anonymous
So why do i get a generator back here ? :s
 
11:36 PM
Because of yield
The moment you add a yield to a function it becomes a generator
 
Anonymous
ah
 
Anonymous
so I need to yield the call to the function, instead of yielding inside it - right?
 
Without seeing your actual code I am going to guess that you want to yield inside the method to get the http response, return whatever you want to return and yield from the calling method
 
@Ocramius I appreciate your review of Yasuos … things … but you fail to convey to him why it's bullshit.
@PeeHaa is @Jay in I-have-no-idea-what-I-am-doing mode?
 
Yes I think he need a nudge in the right direction
been there done that :P
 
11:42 PM
I wonder whether I also needed that long to grasp yield+Promises back then…
Or whether it just goes over most peoples heads?
 
Anonymous
@bwoebi yep
 
Anonymous
@bwoebi I'm a special case.
 
tbh I had a really hard time getting how / what the fuck generators in general were
 
Anonymous
@PeeHaa thanks, that worked
 
\o/
Mostly because nobody could ELI5 it to me
 
11:44 PM
@PeeHaa I mean, what so hard about stop and continue when calling code says so…? I'm having a really hard time to understand what's so hard about them
 
@bwoebi because nobody explained it like that :P
 
@PeeHaa I'm pretty sure I did
 
Not to me and not when yield was added :)
 
Anonymous
Oct 28 at 9:01, by bwoebi
@JayIsTooCommon What's the issue? It marks the passed value as return value for current() and freezes the execution state of the Generator? That's it.
 
Anonymous
This blew my mind because you don't know what simple terms means @bwoebi ;)
 
11:47 PM
@JayIsTooCommon but it makes total sense now right?
 
@JayIsTooCommon Well, it is simple to me.
 
Anonymous
@PeeHaa yep, again my main issue was that I kept thinking that it was giving back control to the last method, instead of the loop etc.. :)
 
Anonymous
Oct 28 at 9:28, by JayIsTooCommon
@bwoebi Listen Bob.. I'm not as weird clever as you are
 
I still want to make some magically animated js execution graph to make it more visual
But I suck at js so I might pass :P
 
Anonymous
> yep
 
Anonymous
11:51 PM
Unexpected yield
 
Anonymous
:D Still getting there..
 
I could have said: executing yield returns and backs the current stack frame of the Generator up. Then the arguments yield has been passed will be stored internally for being returned when key() or current() are called. Now when you call send() the value passed to send is set as return value of the yield expression, the backed up stack frame is put back as topmost stack frame and execution is continued from the instruction right after the previous yield.
^ That's what I do not consider simple.
 
Anonymous
..
 
Anonymous
Shut up Bob
 
Anonymous
:D
 
11:53 PM
I mean, when I read that I can confirm it's right due to the knowledge I have, but I do not expect anyone to be any less confused when he'll read this.
 
Anonymous
@bwoebi Either way it's different for everyone in terms of time to understand things. I haven't been studying promises and generators since I last asked about it in October, I was just curious about it then. Now it's come up again and I actually need to use them, hence trying to understand
 
The thing imho is that it's not actually hard (once it clicks) it's just different from what you are used to cc @bwoebi
 
Anonymous
So, why can I not yield a string? context - pastebin.com/L3207kQC this method is what I am trying to yield
 
Where are you yielding?
Oh you are calling that method?
 
@JayIsTooCommon well, you can only yield Promise in Amp coroutines… so you probably want new Amp\Success($string)
@Jay Success class is basically an already resolved promise
 
Anonymous
11:59 PM
oic
 
00:00 - 22:0022:00 - 00:00

« first day (2247 days earlier)      last day (2701 days later) »