« first day (2384 days earlier)      last day (2579 days later) » 

6:00 PM
its very basic I agree
 
@Luggage not currently but I just joined.
 
@Luggage not today at all
 
Redux solves your problems by making them 10x more complicated so you end up just giving up and moving on. It's effective.
 
basically the idea is that authoritive decisions get updated in redux
without affecting anyone else
so if you write your reducers properly
the game state ( + good ping like say ~200-300ms) will not cause lots of glitches
 
@Vap0r I have to look up the difference between POST and PUT a lot myself. I always forget.
 
6:01 PM
POST is a new resource isn't it?
 
I can always tweak it after I'm done
@Loktar think it as this



                TickStream    - Produces N Ticks per second
                    |
                    V
     ------->    GameLoop     - f(state, action) provided by the dev
    ^               |
    |               v
SyncStrategy   SyncStrategy   - Figures out what actually gets transported
    ^               |
    |               v
    |:n        FilterStream   - Figures out who gets what data
    |               |:n
    |               v
Deserializer    Serailzer     - Figures out what goes in pipe
 
and don't forget PATCH
 
PATCH? Don't think I use that one
 
And HEAD, for when you're extra frisky.
 
what about SMOKE
 
6:02 PM
The feedback to gameloop handles fetching what the client would have seen part
 
http.STATUS_CODES[ 420 ] = 'Smoke weed everyday';
 
@Luggage so should POST only be used for new items, and PUT for current?
 
// I have something like this
const a = {
  data: 3,
  getAThing: (x) => this.data + x
}

// so this is supposed to happen
a.getAThing( 2 ); // 5

// but `this` is not a thing in arrow functions, and I really don't want to do this:
const a = {
  data: 3,
  getAThing: function (x) { return this.data + x }
}

// how do I use arrows?
 
Although this might not be very good if you are writing your own counter strike, but if you are then why the heck are you using node.js anyway?
 
@Meredith remember to log into Gaia today
can't miss a single day
 
6:04 PM
I only use POST and PATCH. POST /users (new user) and PATCH /users/123 (update one). I think that's a correct usage, but ...
 
it doesn't even matter
 
And if that's the case, how should I handle POST request to an {ID} resource? such as POST to api/notifications/{ID}
Not at all?
 
what do you want it to do?
 
IIRC it has something to do with idempotence
Is that even a word?
 
// well, this does work
const data = { b: 3 }
const a = {
  data: data,
  getAThing: (x) => data.b + x
}

a.getAThing( 2 ); // 5

// which I guess would be fine because I'm exporting `a` as a module
 
6:05 PM
@towc this is a thing in arrow functions, it's part of why they're special, it's the this outside the arrow function, which is the global object
 
@Luggage this is more of a "best practices" question I guess. I currently have a way I handle this, but want to make sure it's in line with RESTful architecture, and this seems to be a point where some people are divided.
 
You can use method syntax
var foo = {
  getAThing() { ... }
};
 
Like I said, you have to look up what is 'correct' as I always forget
and I refuse to look it up just to paste the answer to you
But.. If you are consistent, it's fine.
 
I... had no clue method syntax was a thing
damn
 
pleb
 
6:07 PM
and if you support older browsers, you may need ot use POST in place of PUT and PATCH anyway, because IE.
 
get aThing() {}
 
@Luggage 51elliot.blogspot.com/2014/03/… seems to indicate that PATCH has no place, but that is from 2014
 
it's already better than declaring the whole function... but I still need to use return a lot
although I guess that's not much of an issue
 
I'm with Ben
 
it's not too redundant
 
6:08 PM
getAThing() // if the getting is potentially expensive or has a side-effect
get aThing() // if it's local and cheap and you are just returning a value
 
I never even wondered if you can use parameters on get aThing()
 
At my last gig, we had a getter with a cyclomatic complexity of 12... I recall it was due to the back end giving us incredibly awful and inconsistent data that required a shit ton of logic branches in order to parse it
 
You can not.
 
Ah yeah, good point.
 
probably don't name it getX then
 
6:12 PM
meh.
 
.hem
 
.getFoo() is a perfectly reasonable name.
 
if you're not passing in any arguments, yes
 
function getLayout(compact: boolean) {}
 
k
 
6:15 PM
I won?
WOOOOOO
 
imgur.com/gallery/t6YNF @RLEMON @RLEMON @RLEMON
 
Peace among worlds, Jordan.
 
I could totally make one
out of wood
 
I have a think like "getOwnersFromSomething( something )" that maps through the owners and returns all the ones that have a certain property. Using filter all of the time for that is going to be a lot more confusing
I think this is a reasonable scenario
 
@rlemon desk?
 
user2620028
6:17 PM
i just had a weird javascript interaction that i wasn't able to understand
 
where did it touch you?
 
user2620028
i added two window load event listeners
 
user2620028
one fired the other didn't
 
did you add the second one after the window was already loaded?
 
$(function() { ... });
 
user2620028
6:18 PM
no
 
prove it
 
user2620028
cant share the code
 
then I don't believe you
 
did you hit CTRL-S on the file? :)
 
#fakenews
 
user2620028
6:19 PM
thats fine
 
nobody plays that game
 
@Shrek you are super slow.
 
@ndugger You're one to know, with your wide web of affiliates and deep ties to people around the globe
 
thanks for seeing things my way, fam
 
6:23 PM
@rlemon I'm shrek, what part of that did you not get?
 
@Luggage just as an update, IE7+ supports PUT as well. It seems that the lack of support is based on html forms for now. XMLHttpRequest supports all methods
 
oh btw @shrek, I am looking for remote contracts :P
 
it's like an infinite amount of that music
 
to start at the end of july
 
6:25 PM
@ssube Thanks. But I'm not sure why I like it, maybe some form of nostalgia, because usually I'm not turned on by electronic or repetitive music
 
it's fun music until you get bored of the analog synths
 
I was doing some dirty assembly work and didn't notice I had this on for like...3 hours. It zoned me. Was weird.
 
Is anyone familiar with git and can help me to linearize a demo git repo?
 
@ItsmeJulian Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
6:31 PM
I don't get it
 
lol COD zombies
 
COD is a bad game, and you should be ashamed
 
I love black ops zombies
 
oh now you can fuck right on off with that shit Preston
 
on off
 
6:33 PM
how are you supposed to load a local resource which is not a package via webpack? expose-loader? The use case is for jwplayer
 
sounds like a bad solution, if you're gonna package up a media file like that, your bundle is gonna be massive
 
I mean a library which does not have an npm package -- jwplayer is pretty old
 
@corvid what is jwplayer? Back when I last heard of it it was some type of html5 video player with flash fallback I think, now it looks like some type of SAAS thing for videos?
 
@Vap0r it's called a googleable knowledge-adding target
 
basically just a slightly better video tag that handles things like m3u8 files
 
6:37 PM
@towc wut?
 
is there a reason you're trying to load it via webpack rather than directly in the html? some unforseen benefit?
 
@corvid huh seems pretty close to its' purpose 5 years ago.
 
@ssube help
 
just don't go off of any bumps, even tiny ones
you'll be fine
 
@SterlingArcher it's still got so much clearance in the middle
great for those winter alleys
 
6:39 PM
their website is a loop
go do documntation... click link to javascript api... goes to solution page with link to documentaiton..
the same documentation
 
@corvid externals
 
@Luggage I never understood how they work :\ what would that look like in the config, if I have jwplayer at <root>/lib/jwplayer-7.7.4, for example?
 
i feel like we've had this discussion already this week
 
Over the weekend, I bought Rogue One and a star wars lego kit of the millenium falcon. I got really, really high and watched the movie while putting the legos together, and it was the best weekend I've had in a very long time. Legos remind me so much of my childhood.
 
6:47 PM
doesn't it also need a key though?
 
> Hey jordan what's this for?
I don't know, ask Ha or Mark, they know this better territory.
Ok but I don't get why... [several questions I don't know later...]
Like, just ask the right person bro. If I don't know the initial question why would I know the follow up 20 questions
 
20 questions? He was just trying to get to know you better
 
it's brutal man, if somebody doesn't know, and tells me "Oh go talk to so and so, they'll know" i stfu and go ask them
 
@Shrek I didn't get your message anywhere
 
6:53 PM
for (node = node.firstChild; node; node = node.nextSibling) {
I've never seen anybody iterate a NodeList like this
 
Oh boy, 10 years ago it was the wild west
Although, use a tree iterator probably (unless you're actually iterating just the children)
 
@SterlingArcher Half the time when I get told that, it's after I've asked them. :/
 
@SterlingArcher It's definitely abusing a for loop, but if it works, it works
 
@SterlingArcher refactor to for of
@ndugger hardly abuse IMO
 
@SterlingArcher We had a pattern like that back in the good ol days when I did JS. It was so ubiquitous, it wasn't even noteworthy
 
6:55 PM
In C people do this all the time
 
@BenjaminGruenbaum When you're using something for an unintended use, you're abusing it.
 
[...node].forEach(n => n);
 
@SterlingArcher NodeList has forEach built into it
 
@ndugger this sort of use is super common in other languages with for, namely C and Java where the construct was lifted into JS from.
 
well, it does now anyways
 
6:56 PM
oh right, i mean map
 
@BenjaminGruenbaum Other languages aren't this language. That's a terrible argument
 
for(const node of list) {
  // do stuff to node here
}
 
Well guys, PHP did it, so it must be ok
 
@ndugger it's not a terrible argument, you said "unintended use" where this is an intended use.
 
If PHP did it, it IS ok.
 
6:57 PM
PHP: Make goto great again
 
This is a viable use a for loop, which divides initialization, testing, and increment into distinct steps.
 
@SterlingArcher what if coldfusion did it?
 
It's certainly a lot less abuse than for(;;).
 
@towc send your resume? I'll just forward it
also
 
I think "I haven't seen it before, so it's unintended use" is a very weak argument to make here.
 
6:59 PM
ColdFusion isn't even real
 
Ins't the Java

for(Abc abc: ArrayAbc) {

}

a for of and not a forEach
 

« first day (2384 days earlier)      last day (2579 days later) »