« first day (1407 days earlier)      last day (3543 days later) » 

10:00 PM
@SomeKittensUx2666 hi
 
@RussianVodka hi
 
@SomeKittensUx2666 i have some kind of piece of crap made by my mate...
 
sounds familiar.
 
0
Q: Should I completely eliminate try/catch from code where I use (bluebird) promises?

CalifornianI have a couple very basic setup steps before I call my promisified functions and I am considering wrapping them in a try/catch block because that seems the simplest way. However, it seems a little...dirty to me. Should I instead make a function that returns a Promise, even if it is very simple? ...

 
10:02 PM
`var LasyLoad = function(options) {
options = options || {};
var nodesContainer = options.nodesContainer,
scrollContainer = options.scrollContainer,
// requestFunction = options.requestFunction,
parserFunction = options.parserFunction,
button = options.button,
url = options.url,
pageParamName = options.pageParamName,
page = 0;

if (scrollContainer) {
scrollContainer.onscroll = handler;
} else {
console.log('FCK');
}

if (button) {
button.addEventListener('click', handler);
}

if (nodesContainer.scrollHeight <= nodesContainer.offsetHeight) {
OMG
 
You OMG'ed at your own code?
 
Not my
Sec
document.addEventListener("DOMContentLoaded", function() {
var ll = new LasyLoad({
nodesContainer: document.querySelector('.bdiv'),
scrollContainer: document.body,
parserFunction: function(data) {
return data;
},
url: '',
pageParamName: 'npage'
});
}, false);
It's in <script>
 
Guys, do you know of any (preferably video) resources about express?
 
And the problem is in... It's not scrolling.
If i don't scroll when i'm refreshing the page
 
> QUnit supports the same browsers as jQuery 1.x.
closes tab
 
10:05 PM
As you can see, theres a console.log debug stuff
If it's not working it's: scrollHeight: 1037 :: scrollTop: 0 :: offsetHeight: 491
 
@RussianVodka Format your code - hit Ctrl+K before sending and see the faq
 
Otherwise: scrollHeight: 1037 :: scrollTop: 546 :: offsetHeight: 491 lasyload.js:58
scrollHeight: 1037 :: scrollTop: 546 :: offsetHeight: 491 lasyload.js:58 ...
@CapricaSix ok. Thx. I watched FAQ, but there was only about code
 
Hand-rolled AJAX.
 
I never understood this fear of XHR
 
Heh) It is. But actual ajax is ok.
The problem is when it makes document.body.scrollTop == 0, script doesn't respond to scrolling
And i dunno why( Only you guys can help me... And the God i think...
 
10:10 PM
@RussianVodka Can you make a JSFiddle?
 
@SomeKittensUx2666 ok
 
"hand rolled ajax" is like 4 LoC
var xhr = new XMLHttpRequest
xhr.open("GET","whateverurl");
xhr.onload = callback; // might want to catch errors too
xhr.send();
 
@BenjaminGruenbaum good joke man)
 
Nono, that's literally all of it.
you might want to callback with the response text and not the event though
 
@BenjaminGruenbaum When will v8 get fat arrow?
 
10:12 PM
@copy they're making progress, I hope that in ~2 months but it's taking forever
function get(url){
    return new Promise(function(resolve, reject){
        var xhr = new XMLHttpRequest;
        xhr.open("GET", url);
        xhr.onload = function(){ resolve(xhr.responseText); };
        xhr.onerror = function(e){ reject(new Error(e)); };
        xhr.send()
    });
}
 
@RussianVodka here, that's "fully blown" ajax that returns a promise so you can aggregate and modify bits.
 
now the number of particle is based upon the screen resolution and they collaborate and charge and the world is like portal.
 
@AbhishekHingnikar zombie apocalypse model?
 
@BenjaminGruenbaum Assembler - the best :D
 
10:14 PM
If you want to have it send data accept a param and pass it to .send, if you want to make a POST accept a method type optional param.
That's the whole story.
@RussianVodka ?
 
@towc idk which model it is but its fun to watch
 
@BenjaminGruenbaum nevermind. Just nevermind...
 
it includes the current library version
 
@rlemon halp
 
I'm just having some problems with path fillings (less than last time) and context rotation
 
10:16 PM
@BenjaminGruenbaum The problem, i think, isn't in AJAX. It works. And i really don't care for now how it's doin' it. I mean. I have no JQuery. Only Pure JS that was wrotten not by me.
 
globalAlpha is making things weird
 
Sooo..
 
codepens not showing me anything
 
@RussianVodka all I said is that XHR is very simple, it's a simple straightforward API, "hand rolling it" is trivial.
 
@rlemon click
 
10:17 PM
@rlemon Expand the demo screen a bit
the trouble is the Points are setting the global alpha, which is making my rockets not visible.
 
@BenjaminGruenbaum sorry, but i can't understand you as deep as i could if i learnt js for about year, two...
 
@RussianVodka what?
 
@BenjaminGruenbaum i DON'T KNOW JS! I learned PHP for about 5 years, Java for about a year, BUT I DON'T LEARNED THE JAVASCRIPT!
 
@RussianVodka so what?
How is that related to anything?
 
10:20 PM
@BenjaminGruenbaum i can only do some AJAX in JQuery, cause it's simple
 
I didn't know Swift or Objective-C two weeks ago
 
^ should help you some
 
@CapricaSix what?
 
@RussianVodka that doesn't make native XHR "complicated". That's really all I said.
 
10:22 PM
That's simpler
 
hey just a PSA you don't need to use RAF polyfill anymore.
 
@BenjaminGruenbaum i don't disagree with you. Just saying you that i don't know the js. And i don't know much about XHR and other stuff, but i see that it works. I can debug that stuff as much as i can, but i don't know subtleties that can affect this and make some buggy bugs...
So i ask you here)
Wait a sec.. Making JSFiddle
 
JSFiddle will help a lot
 
@towc now i am adding bases
!!sleep or add bases
 
10:26 PM
lol
 
wait, what?
 
!!should i sleep or add bases ?
 
@AbhishekHingnikar add bases
 
!!help sleep
 
@AbhishekHingnikar sleep: User-taught command: <>http://3.bp.blogspot.com/_HyyDHyAwI6k/TA0NA_Po-FI/AAAAAAAAJcM/-qP_xvEuAqA/s16‌​00/sleeping+girl.jpg
 
10:26 PM
!!sleep or add bases
 
add bass
 
Haha
 
@AbhishekHingnikar ??
 
10:26 PM
@Loktar :-> i am also adding human control now hehahaha
 
@Loktar halp i am work 10 days no help google lots cannot make squares stay solid color: codepen.io/anon/pen/yfukE
 
AI is now...
 
@towc just watch bro just watch, i amma make u feels proudz
@Loktar i might need some help game jesus :P
 
stay your solid color?
you dont want them to fade?
 
@Loktar fading makes my gpu lag
 
10:27 PM
@AbhishekHingnikar as if I wasn't proud already
 
@SomeKittensUx2666 this seems a bit overly complex
using images rather than flls
 
@rlemon said it was fasta
 
not if you decide to scale
drawimage/scale is pretty slow
also rotating
if you want to get the fastest anyway for stuff like this youd use putImageData
 
Kittens, i sure you know that i can't make it work in JSFiddle
 
10:30 PM
I mean... No server and stuff
I can remove AJAX
 
@SomeKittensUx2666 whats the issue though, I dont understand, they seem to work ok
 
I've been fiddling with it (pun intended)
I think I've got it
 
@Loktar i just realized the grave mistake i made
T_T
 
@AbhishekHingnikar whats that?
 
i forgot dt now its running at whatever frame rate is :-/ so horribly unsuitable for animations :-/
and gameplay
 
10:33 PM
ahh
well Im off to get some jimmay johns! :P
 
probably should move it out of this codepen and write better code on sublime
 
I think i found
 
my boss will kill me :-(
 
oh wait you're writing code in Codepen?
 
10:33 PM
for writing this in almost 1 night
@Loktar yeap
 
damn man thats dedication
 
@Loktar yup!
 
@Loktar guess what ? I am writing this on an iPad mini.
and it has crashed idk how many times xD
 
lol jesus man, what did you do so wrong to punish yourself so much
 
i didn't finish my products website in time.
 
10:35 PM
oh shit! My cdtv sold
nice, been sitting on ebay for like 2 months
/me goes to get dinner for real
 
And the irony that for the price of an ipad mini you could buy a half-decent laptop
 
Wait, now it's really laggy.
probably because I'm generating tons of new elements every frame.
@rlemon GET OVAR HYAR
 
what is your end goal here?
 
!!afk night
 
@rlemon firework goes up and explodes
the trouble is the way you did it, with the global alpha filter.
 
10:42 PM
@copy that will lag ?
 
Holy crap! I only just figured out that ´!value´ would trigger with any falsy value. Worth remembering lol.
 
@copy you can't hold a half decent laptop and watch videos on a bus for an hour comfortably. Although yeah it's overpriced
!!afk sleep
 
@SomeKittensUx2666 just set it back after you're done rendering the particle
or before you render the 'rocket'
 
@BenjaminGruenbaum Sure you can, I do it all the time.
Don't forget, I take 3 hour bus drives on a weekly basis.
 
10:51 PM
Ah, there we go: codepen.io/anon/pen/yfukE
 
@SecondRikudo get an iPad mini, you won't regret it
 
@BenjaminGruenbaum isn't iPad mini === iPhone?
Only, you know... minus the phone?
 
11:07 PM
do the bases look okay ?
 
what? an old livestream of notch writing js games? twitch.tv/notch/b/459230065
 
@towc u like the bases ?
i am adding human controls atm <3 <3
then you should be able to make bases and fight :3
 
@AbhishekHingnikar what do you mean by bases?
 
The "base camps", the swarm will now only come out off the base.
 
is there a way to get the space on the $(window) that is currently not occupied?
eg, get the height from here to the bottom of the window
 
11:10 PM
@AbhishekHingnikar for me they all come from the top
also, the code is pretty overcomplicated
 
the looks bro.
 
@corvid window.height-here?
window.height-document.body.height
wait, body has no height
window.height-document.body.getBoundingClientRect().height
@corvid this is the way to go
if it's negative there simply is no space left
-_-
window.innerHeight*
I suffer from braindiarrea
 
hm, doesn't seem to work
I'm sure I'm thinking about this very wrong.
 
@rlemon why not use fillRect?
 
11:38 PM
huh?
 
instead of:
context.beginPath();
context.rect(0,0,r,r);
context.fillStyle = 'rgb(0,0,0)';
context.fill();
context.closePath();
 
ohh
idk. because at the time I decided to do it that way
no real reason
 

« first day (1407 days earlier)      last day (3543 days later) »