« first day (2392 days earlier)      last day (2779 days later) » 

18:00
This is my first really complex REST API and my team and I are confused on when to use a parameter, and when to use a slash.

Say I want to get all the messages associated with an entity...

I could do this...
/business/{ID}/message
/entity/{ID}/message
/message (non specific)

Or I can do this...
/message?business={ID}
/message?whitelabel={ID}
/message (nonspecific)

How does one decide whether something is a filter or a specific resource?
does each entity or business have only one message?
@Luggage No, that is a list.
@rlemon these guys are crazy wtf is this intro
what is even australia
/business/message/{ID} would get you a specific.
/business/:id/messages
/entity/:id/messages
/messages?entity=:id
18:02
^ and V
/business/:id/messages/
@SterlingArcher what did I just watch even
@Meredith You're not supposed to use plurals.
@Allenph bullshit
Says who?
18:03
You definitely are
I know Mr REST personally. and he's ok with plurals.
you aren't supposed to use plurals for the root resource, but for a list of children, you can
yop there
@lix songs are dope, videos are fucking amazing
crazy, but amazing
/businesses/:id/ is wrong
18:04
it is good practice that only the last part of the path can be plural
Huh. I don't remember where I read that, but I was under the impression that it was cleaner for you to not use plurals. The reason being that you're going to have an unused singular route with no specificity anyway.
@SterlingArcher but am currently listening to pantera.
@SterlingArcher the music is on point, just the whole hag scene lmao
you can pause pantera :(
I paused Machine Head for this
You want it to be clear what the resource is
/businesses/:id doesn't provide any clarity over /business/:id but :id/messages does
18:05
if you're doing standardized searching and endpoints, you can do /business/:id/message/:id
but that's kind of an antipattern, nesting your API
1 message moved to Trash can
@azro Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
:36948417 I don't think the browser will like you opening multiple new windows at once.
youtube.com/watch?v=9iGnyf6SJjc @SterlingArcher let me know what you think
@ssube I see. I should have an endpoint for getting a list that is nested, but should also have a main resource endpoint.
I certainly won't like you opening multiple tabs at once. It'll remind me of early web porn days.
18:06
probably, yeah
This is good, not quite my style of music, but I can hear the talent
1 message moved to Trash can
@azro Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
in fact, the nested endpoint could redirect to the other one with a preset filter
@azro don't try to post text with code.
Yeah the guitar player is ungodly talented
18:07
@CapricaSix thanks to delete ... i tried too ^^
that's kind of unnecessary, you don't want to redirect if you can help it, but you should definitely implement Business.getMessages as () => Messages.getByBusiness(id)
Caprica is a bot
this is more my speed :D
gotta love a good bit of machine head
18:08
@ssube What is unnecessary?
@SterlingArcher it's good. not their best.
And yeah, there's a model service.
@Allenph using a literal HTTP redirect
Imperium might be my favorite song
I never mentioned any redirects.
18:08
He did
I did
Imperium is a damn good song.
drummer goes ham
because you'll have two identical endpoints
18:09
@Luggage ^^ i made a tool which provide about 20 links and normally you'll need to click on each so i want to be able to open all in one click ( pastebin.com/KZc9mhAi )
dat intro
@ssube Can't I just have both endpoints call the same controller?
you can and should, that's what I was trying to say
The routes are tint and just call controller methods.
there are a few ways to go about that
18:10
Yeah thats why the http redirect is unnecessary
I saw periphery live like 5 years ago
I'm a meat popsicle.
Actually probably 4 years ago
They opened for deftones
:o that so sick
18:11
@lix gojira?
Yeah it was during the koi no yokan tour
Which was a fantastic album
@SterlingArcher not heard of them, I'll check em out
this video is awesome
i wish spotify had playcounts because I've listened to this song like 1000 times
18:17
@SterlingArcher you know there is other music out there?
@SterlingArcher Darkness Within is a close second.
you know what.. it's incredibly hard to pick a best machine head song. they're all amazing.
@Shmiddty you want me to listen to Iggy?
I've already been through my gangster rap phase
@SterlingArcher Have you gone through your Brony phase yet?
do you like folk music?
or is that not angry enough for you?
@Shmiddty nah not really
@Trasiva not yet, I think that hits around 50-60
18:26
y u mad bro?
@Shmiddty Maybe he prefers to vent his anger through hard metal, instead of being a shitty troll?
@Shmiddty folk music is super angry
they all hate everything and sing about the people who have done them wrong
Yeah I know some angry folk musicians
all the folk musicians I know are secretly very angry people
Heavy metal does calm me down
18:27
cept machine head
that always pumps me up
great for working out
and slayer
what's that one song where 3 guys are sitting on a halfpipe singing
I heard that john denver secretly hated west virginia
they all have little instruments, one guy is just hitting a ring on a bottle
i like that one
@SterlingArcher I consider us friends. Let me know if my jesting bothers you
lol you're good
user2620028
18:28
my mother used to listen to slayer
in your face @Trasiva
user2620028
was somewhat odd going through her album collection
My mom saw iron maiden live
lol shut up @Shmiddty
huehuehue
user2620028
18:29
apparently my parents were at farm aid
I only troll because I don't know how to properly expression emotion
Learn.
RTFM
no u
even my dad has a jacket with a bunch of old band pins
and my parents are not the most outrageous
@Luggage I'm not reading the DSM
18:30
my mom listened to blue rodeo
user2620028
yeah its just weird to think of my parents enjoying time doing things like that
my parents were boring af
user2620028
the funny thing is, my parents owned almost all of the cars i wish i could own in my lifetime, and have seen all the bands in concert that i would want to see
I'd like to have seen Queen
user2620028
18:32
yeah i would love to see queen
user2620028
i went to a journey concert but its not really the same without steve perry
@Shmiddty No thanks, I'm rather keep stuffing my face with this delicious meal and not shit.
You could try getting into other music
user2620028
yes im sure the easiest solution to this problem is to change my personality to like other things i don't like
@Trasiva y u mad, bro?
18:33
Exactly
Now you get it
put on super skinny jeans
expand your horizon
wear eye liner
the pain will change your outlook on life
user2620028
but i don't have any pain
18:34
right, that's your problem
You gotta create the pain
the pain of having no pain
Find a nice girl then make her break up with you
Community covered this
it's legit
18:34
@Trasiva ;)
user2620028
see that is the odd part, maybe its a personal thing. Whenever something hurts me, within moments the pain goes away and i almost forget it ever happened.
The singer of one of my favorite emo bands is a middle school english teacher
"hurt me so I can feel something"
ah, so you have plenty of stuff repressed
You dont need to have pain
18:35
that's good, bring those back out
get them into the open and then use them to power the darkness inside of you
user2620028
so you guys are saying that i could take that very brief momentary illogical response and keep it bottled up inside of me so i can ruin my own life? I don't have to wait for something else to do it for me?
and also above and below your eyelashes
@HatterisMad only you can ruin your life. Nobody else exists except in your mind
user2620028
@Shmiddty for some reason as a young kid at times i believed that
user2620028
or at least i have memories that make me think young me believed that
18:37
if everyone was a figment of my imaginations I'd have thought I'd have more friends. :(
it's easy to believe because it's hard to disprove
solipsism.
It's all middle schoolers like "this is my teacher"
It's so cute
in middle school, I had a really hot english teacher
18:38
I had an awesome english teacher who didn't give af, but never the hot one.
liquid hot magma
user2620028
@Shmiddty had a 21 year old teacher as homeroom teacher in 6th grade... was wonderful
I had a semi attractive history teacher
fresh out of teachers college.
@Shmiddty you didn't even comment on the song and I had to do very obscure google keywords to find it :(
I never had any hot teachers
I feel like I missed out
18:39
there was also a math teach who once claimed that I was making bird noises in class. I don't remember doing it, but sometimes I think that I did
one of the students ran into her at a rave. they both just kinda stared for a minute then backed away
user2620028
@rlemon that is amazing
SO many of the guys tried to hit on her. myself included. granted it was the first day, she was wearing a backpack, and standing outside of the classroom.
user2620028
18:41
one of my friends asked out one of the gym teachers to prom
user2620028
he didn't know it was a gym teacher
Dank
basically how it went. but not to prom. I just started hitting on her.. then she opened up the classroom and sat at the teachers desk.
I went tomato red and sat at the back
ha, loser
Dork
18:42
it was like tenth grade. I felt like a total ass
user2620028
he walked into our gym class like 15 minutes into the period and we were all just chilling and talking to each other because the teacher was having a fuck it kinda day, he walks straight up to her and asks her to prom.
She took a moment and responded with "Do you want a detention?"
So at what point did lemonparty ruin your house parties?
never really did tbh
> Are we still going to lemon's party tonight?
internet was still all about 5 hours mp3 downloads and there were no smartphones when I was in HS
18:44
oldy moldy
user2620028
@rlemon irc?
AIM
😃 ICQ as well.
MSN Messenger was starting to pick up
I still know my aim login
user2620028
i remember the yahoo messenger and aim and msn timeperiods
user2620028
but i was fairly young for that
user2620028
18:45
took 6 hours just to download yahoo messenger
I recall on MSN mistaking a Kristina that I went to school with, and a Kristina that got my contact from a friend of a friend.. invited me to a party - I thought it was the other kristina so went. ended up dating her for like 6mo
user2620028
and then you get it installed and it seemed like the only people you were talking to were pedophiles anyways
@HatterisMad I used to fake being a young girl, then switch to pasting that 'FBI' warning.
@rlemon Did you show up to the wrong place?
no, she gave me the directions. I had never been to eithers house at that point.
18:47
hello
user2620028
@Trasiva good times
@Roshan 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.
I was quite confused when the door opened tho
@rlemon oh damn, that would have been a good story
user2620028
18:48
buzzfeed still exists?
Yeah
why [1,2,3][2,1] returns 2
Cuz you're accessing 2
because 2,1 is an expression returning 1
!!> 2,1
@rlemon 1
user2620028
18:49
how does that expression evaluate?
not clear ?
what operator is used here then
@HatterisMad very carefully
!!> let x = (2,1); let y = [1,2,3]; y[x]
@Roshan comma operator.
@KendallFrey "SyntaxError: missing variable name"
18:50
oh pooey
user2620028
specifically the 2,1 part
@KendallFrey 2
user2620028
how does 2,1 evaluate as an expression
it's a comma operator.
comma operator evaluates each expression left to right and returns the right
18:50
comma operator ? any reference for this
@HatterisMad Comma operator evaluates both sides and returns the right side
@SterlingArcher which song?
user2620028
ok i never knew that
Yes. there is a reference. Google "mdn comma operator"
user2620028
18:51
so if both sides are true then it returns the right side?
It's like >> in Haskell, that should make it clear :P
user2620028
returns the value of the right side?
@HatterisMad it always returns the last expression
@HatterisMad no, just always the right side
Never use the comma operator.
18:51
why
It's nothing but confusion and I can't think of any where it's needed.
it's never the best choice
because it gets ugly fast.
comma operator is great for code golf
user2620028
why does it exist then
user2620028
18:52
what use case
@HatterisMad Ask C
it exists because Javascript
@HatterisMad it's a fundamental part of the language
it's how assignment works and all sorts of other things
foo => (bar(),returnValue) // ew
18:52
@ssube Not really... is it?
@SterlingArcher what aboot it?
you're mean
how to pin a object to "this" in a function call
you're median
@KendallFrey think about where it's allowed. You'd have a hell of a time extricating it without changing the semantics of other stuff.
18:53
@Roshan bind
It's nice if you're a shitty debugger
@Roshan .bind,.call,.apply
depending on the use case
arr.map(i => (console.log(i), i * i))
@SterlingArcher I'm not trying to be. I'm not sure what the context is
@ssube I don't get what you mean. There are several cases where commas are used that aren't as an operator
18:53
But rumor is you immediately get cancer if you do that
but they're still creating a list of expressions
@Shmiddty you asked if I liked any different music, and I went on a long hunt for that song because it's different, not pop, and unique
those just happen to be stuff like assignments, with side effects
I liked it
any good reference to learn functional prog using javascript
18:54
@SterlingArcher oh ok
@ssube Which isn't at all what the comma operator is about
I don't know if the parser do it, but you could only implement commas once and let everything else use that
@KendallFrey but it does
@ssube You could, but not without changing the language
it creates a pair of and then list of expressions that execute
@SterlingArcher how do you feel about blues?
18:55
I think you'd have to change the language to prevent commas from being used everywhere
How does everyone feel about slowcore
!!s/e$/n/
@KendallFrey how is backbone different from react
@rlemon How does everyone feel about slowcorn (source)
I bought an i7 prefer I prefer fast cores
18:56
@Roshan Why the fuck would I know?
How are cars different than the color green?
user2620028
if they are british cars then they are one and the same
Why the fuck would that get flagged?
Did you say "fuck"?
Fuck, I did.
18:57
haha
f*ck
You're fucked, mate.
oh, no, you're good
be polite
that goes to you as well.
This is a long shot, but has anyone ever used WebTorrent? The bloody thing refuses to do any kind of connecting.
18:58
i was and i am polite
bugging people isn't polite
Good. Let's all be polite together.
randomly pinging people with random questions is bugging them.
anybody know a tool to graph data schemas?
ask a question is not bugging
18:59
like a good one, ideally something that can work with GraphQL
or Knex
and being rude is
K'nex is a fantastic toy

« first day (2392 days earlier)      last day (2779 days later) »