« first day (1894 days earlier)      last day (3279 days later) » 

15:00
ah ok wait
Is there any reason this should not work?
class Cursor extends Array {
  constructor() {
    super(...arguments);
  }
}
TIL Alt+D = focus on address bar
:27725189
no.. still loading page. doesn't remove loading
but heck, F6 is suitable
@DininduWanniarachchi jsfiddle.net/td503ycd/3
Remember it won't work as this code is inside a fiddle
15:08
@corvid Although ES6 makes Arrays extendable, browsers still don't like it
@ndugger Is it considered bad practice? Seems easier than re-implementing basic functions
Nah, I don't see anything wrong with it, browsers just haven't made it possible yet. Well, Chrome hasn't, I know.
If Chrome hasn't, then probably most others haven't (except maybe opera?)
lol, Opera is just Chrome, but reskinned
If anything, Edge might've implimented it
Edge? Like... microsoft?
15:11
@Zahid Saeed
wow it works
@corvid Yes
What's the deal with microsoft all the sudden being really good? It seems to have come out of nowhere
!!zalgo just checking my fonts after reinstall
@DininduWanniarachchi Thanks glad to help you out :)
15:13
@AwalGarg j̡̨̧̐ͣ̿̊̓̐u̶̡̹͙̠̘͛̃ͯͮ̉ͫ̈́ͅs̨͎̻̳̓ͬ̾͝͠ͅt̵̹̭̠͉̠͇͙ ̭̭̤̖̬̓c̪̤͙̬̈́͊ͥͫ̽̔h̸̶̊́ͨ̈́̉̃͋ȅ̶҉͠͏̹͢c̢͇̗̪̰̣̳̥̊̌͂ͬͨ͋̚͝k̸̶͓͇̫͙̰̟̮͊̀͑͂̌ͧ́͟͠i̴ͥ͋ͣ͑͜͠n‌​̢̭̱̲͖̯̀gͯ̅̎ͤ̉͛͋́̀̕͏̥̻̥̲͕ ͊̄ͭ̎̽̄҉̡͔̼͉̲m̴̴͖̙͔͎̝̣̞̓ͬ̈ͥ͛ͨ́̚͜͞y̸͓̲͇͙͖̳̏ͦ̽̃̔̊̚͜͡ ̸̷̥̹͎ͩ̀͢͞f̷̢̖̱ͫ̍ͤ̕ö̵̡̺̖͓̻́͗̇̐̏ͬ͡͝ͅn̴̟̻̖ͩ̀ͅt͇̫̣͚̺ͣ̔̀s̨͔̙̭̲̗̐͂͊̊͐͒̾̀ ̷̴̨̗͕̰͍͎̲̦ͤ͘͡a̴̢̢̫̹͋͞f̢̫͎͕͕̀͠͠tͬ̒͘͏̠̖̮̹̱͔̀ę̵̙̉͛̍͂ͣ̆̚͟͜r̴̫̐̂͒͢͟͝͝ ̘̦̦̯̱̥ͫr̡̛̖̹̓͐͗ͣͥ̚ę̶͈̟͚ͥ̀̿͜͡͠iͣ͒̏͗͏̳̗n̨̛̝̹̯̖ͣ̕š̷̪̞̮̘͌̅́ͅt̠͆͊͌̍̈͟a̴̢̨̛̳̮̘̠͙̥ͮl̔‌​̵̤̉͐̈́l̨͌̑ͩͮ̋̓̆͏̛̛͉̖̱̻̥̘̬͘
Guys, using an nginx reverse proxy, can anyone remind me what the Upgrade header is used for?
I've never fiddled with nginx
@MadaraUchiha Switching protocols
@Zahid Saeed welcome
15:14
@MadaraUchiha negotiation of connection protocol
And if I don't switch protocols (i.e. from http to http)
I don't need it?
@DininduWanniarachchi I'm answering your question. Need some up rating :P
not semantically/normally
You shouldn't, no
@Zahid Saeed Thanks
15:16
Anyone used the new chrome push notification api yet?
you mean the service worker one?
link?
Facebook used it, and unfortunately, I opted-in...
wait, yep
15:18
then yes, I have :)
crl
crl
  constructor(...args) { // just do that
    super(args);
  }
Have you specifically used the push notifications though?
It is not the "chrome" one btw, and also not new at all :P
@crl Not the same.
not in production, if that's what you mean. Used === played with them.
crl
crl
15:19
and now :)?
Still not the same
constructor (...args) {
    super(...args);
}
crl
crl
...yea
@crl Lookup the spread operator :P
the first one puts them into a list, and the second one spreads them out
15:21
ThinkJS looks really nice
crl
crl
constructor (args...) { // clearer imo
    super(...args);
}
well no
@BenFortune my framework's API is cooler
mine also has a cooler name
@ndugger Decorators <3
aye m8
I'm getting close to a beta release
I might try it out, looks pretty :>
15:27
I'm gonna have a launch party all on my own, in my basement, drunk. I'll let you know.
crl
crl
I need a micro vanilla dom-binding thing to pass some objct to a modal and get it back later
(don't really want to include angular, or ko)
@ndugger The controller part in your readme, any reason you aren't using import {Controller, Router} etc?
this is my fb lol
Is it to force a constant?
crl
crl
your fecesbook?
15:29
@BenFortune I am, actually, the readme is kind of outdated
function some() {}, var some = function(){};
is this functions are same.
returns
@DininduWanniarachchi No, hoisting
except, I've been doing more like...

import Blackbeard from 'blackbeard';
const { Controller, Router, View } = Blackbeard;
const { MapRoute } = Router;
but I do have blackbeard set up where you could just straight up import those things from 'blackbeard'
the framework is very opinionated, but I do give a couple of options on how to do different things
marko looks interesting too
crl
crl
as soon as I see opinionated on GH I change page :)
15:31
It's meh; but it's the best templating engine I've found for node
hbs is my to-go-to if I'm not using react
Used to be jade until I switched to hapi
ew ew
I used to love EJS, but it's kind of dying, strangely
crl
crl
looks like php to me
15:37
you look like php
crl
crl
I didn't say php looks bad
we all know
I'm planning on making it easy to switch out the templating engine in my framework, though. Marko will be the default, but I want to support jade at the very least
Guys
function map(arr, cb) {
  return (function mapper(arr, cb, i) {
    if (arr.length === 0) { return []; }
    return [cb(arr[0], i, arr)].concat(mapper(arr.slice(1), cb, i+1));
  })(arr, cb, 0);
}
Girls
15:42
Any better way to do that?
(i.e. while keeping the recursion)
function map (arr, cb, i = 0) { ... }
@ndugger But then people can fuck me up with map([1,2,3], x => x*2, 42) // lol
True, if you want to protect it, you seem to have the best way of doing it
Madara, i cannot do it better
15:45
waiting for @BenjaminGruenbaum to laugh at me and implement it in 0.7 LoC
Why do you need it to be recusrive?
@ndugger Proof of concept.
I know it can be done very simply with a for loop.
@MadaraUchiha What about using reduce instead?
@MadaraUchiha Am I crazy, or is that padding on that book a little...off.
@BenFortune Array methods not allowed.
That's what we're implementing.
15:46
@MadaraUchiha What that code is doing it btw ? :P
@Trasiva Looks fine to me.
Well, clearly I need to lay off the sauce at work then.
@MadaraUchiha spread operator and generators?
@AwalGarg Uhhhh, a bit too advanced for the target audience.
@BenFortune No, he's right.
That's the point
15:47
@MadaraUchiha If there is already a builtin function then why are you creating your own instead ? :P
@ZahidSaeed Teaching a friend.
@MadaraUchiha I was joking, I'm terrible at CSS :(
It's a very good way of gaining understanding on how these functions work
Implement them yourself.
@MadaraUchiha oh, ok. was wondering why you would write it that way :P
@MadaraUchiha Right. But I always get confused, aren't .filter() and .map() works the same way ?
15:49
@AwalGarg Although now I'm intrigued, what does the spread operator have to do with it?
@MadaraUchiha Can you say that again?
@ZahidSaeed Nope.
They both returns a new array
@ZahidSaeed Yes.
function map (array, callback) {
    return (function mapper (array, callback, i) {
        return !array.length ? [] : [callback(array[0], i, array)].concat(mapper(array.slice(1), callback, ++i));
    })(array, callback, 0);
}
15:49
So what's the difference then ?
slightly shorter via a ternary
@MadaraUchiha .push(...array), push is variadic.
@MadaraUchiha You could leave out the extra arguments to the callback for simplicity
What's the benefit of returning a function ?
15:50
@ZahidSaeed he is not returning a function
@copy Hmm?
@ZahidSaeed I'm returning the result of the function
Note that it gets called immediately.
crl
crl
!!> var a=[]; a.push(1,2,3); a
callback(array) vs callback(x, y, z, array)
@crl "1,2,3"
oh I see
15:51
@ndugger you can even remove the negation and swap both blocks
@MadaraUchiha Without array or i parameter
@KarelG why would I do that?
[cb(arr[0], i, arr), ...mapper(arr.slice(1), cb, i+1)]
@copy Yeah, no, that won't pass the test cases.
1 byte less :^p
15:51
@MadaraUchiha ^ your expression after "return"
@Zahid Saeed are u here
@MadaraUchiha Change the test cases
1 byte less is a terrible reason to do anything, lol
@DininduWanniarachchi Yes
@AwalGarg Yeah, that would be too magical for my audience :D
15:52
Aye, ES6 would allow you to make it a lot smaller
I'm going to go through ES6 syntax after I establish the basics
doing things declaratively, functions as first class citizens, async
I'll slowly trickle ES6 stuff into it
@DininduWanniarachchi No.
are the function parameters closured as well?
const map = (a, fn) => (const mapper = (a, fn, i) => !array.length ? [] : stuff)(a, fn, 0)
And asking for it is the best way to get you downvoted.
15:54
@DininduWanniarachchi What is it ?
my parens are probably wrong
that's ok
@Zahid Saeed that u answered "Pure JavaScript Page Loading Effect"
@MadaraUchiha (general question, not just for you) why do people teach ES6 separately from ES5 to beginners? I don't get the reasoning behind the separation, specially when transpilers are gonna stay for long anyways even after ES6 is widely supported.
@AwalGarg In this particular instance, because my target audience is a Java developer.
@DininduWanniarachchi Yes, so?
15:56
So lambdas are OK, let and cost, sure, destructuring and spread? Maybe later :P
@MadaraUchiha oh, so it is more of a feature set separation than version based separation?
But why ?
I've kicked @DininduWanniarachchi
If someone else has the same problem then he/she will
Please refrain from asking people to vote on your posts.
15:57
lol :D
whoa npm files have these big numbers in the folders, is that a hash of contents?
@AwalGarg Yeah
Normally I teach as though ES6 is the only thing there is.
@MadaraUchiha How do you kick people ? I wanna know :P
Is there any button or what ?
@ZahidSaeed Room owners and moderators can kick people out of rooms.
you have to be a room owner, or a Moderator
15:58
How can I be the one ?
like Neo?
@MadaraUchiha : is the target audience java developers ?
I don't care about ES6
there can be only one
15:58
@ZahidSaeed You are appointed by the other room owners.
If you prove that you deserve it.
@Rolf Why would you not?
Start by not asking googleable questions
@KarelG In this instance, yes.
okay i will :)
there is a java8 .map function though
15:59
@KarelG Right
But not for collections, only for streams
@AwalGarg How do I become ungoogleable?
I actually like Java's implementation of the collection (there, Streams) functions.
@ndugger too much hype and I'm busy doing stuff with the "regular" JS. When ES6 will be properly supported then I will pick whatever suits me from it, I already like a couple of things and will surely be using some but that's in the future
You only iterate the collection/stream once.
i don't like hype
15:59
Very efficient for servers.

« first day (1894 days earlier)      last day (3279 days later) »