« first day (2757 days earlier)      last day (2414 days later) » 

15:00
If I put all "neutral", will it say I don't have a personality?
I am getting an error on this line const port: number = process.env.PORT || 3000;
Type 'string | 3000' is not assignable to type 'number'.
With typescript.
> I am a neutral and particularly uninteresting being
process.env.PORT is evidently a string
how can I resolve it? Am I missing some typings or what?
@KendallFrey Yes, but it shouldn't be. it should be "any".
@mega6382 Yeah the process.env.PORT will be a string, try parseInt(process.env.PORT, 10)?
or say const port: number | string = process.env.PORT || 3000
15:03
@corvid so long as they don't think you're a lizard in a skin suit you're probably ok.
@corvid Seems like an ugly solution to me.
@mega6382 for converting a string to a number? really?
@corvid how 'bout Number(process.env.PORT)?
@mega6382 Let me guess: you're passing it to http.createServer or express or something?
If so, I wouldn't bother typing it because those already have the definition for the port they accept
@KendallFrey No, I mean it is used very often in express and I have seen it used as is in many codebases. So, I am sure that there is a way to do it without typcasting it to number.
@corvid Yes, express.
15:07
@mega6382 that's not how programming works
@mega6382 If you're ok with handling strings, just do process.env.PORT || "3000"
@KendallFrey hmmm, actually thats not such a bad idea.
huh, babel doesn't support BigInt yet :/
I have so many questions
last activity was on Sept 2017
which makes me slightly upset
but then Infinityn shouldn't be a thing, so that's ok I guess
Pipeline operator when
15:20
Hello! If someone feels like reviewing my code, it would be much appreciated. I'm practicing some things by implementing a plugin system for any object to extend with... codepen.io/Frondor/pen/MGopZx
Line 35: Person.$options = {} // for static use
I'm just not happy with that
pls no $
I prefer $ instead of underscore simply because they are not truly private. And the underscore is widely intended for private properties in programming
But its arguable ofc
and a dollar is widely intended for trading
@Frondor when I see $ i immediately think it's jQuery related
also why aren't you happy with it, would you rather not use static properties?
You're not clearly trading here, please, remain serious.
@johnmarinelli I agree. Thankfully I stopped using it long ago
I'm not happy with it because it is outside the class definition
15:30
@Frondor right, but many others still use it, so if someone else sees '$' they might think you're integrating jQuery or something
I can't use a getter / setter to set that object itself... And it should be initiated because the class instantiation so... I'm lost on that
@Frondor We make jokes in this room, humour is allowed, accepted, and encouraged.
10
I've seen many large nodejs codebases using it instead of underscore
Whatever
@Frondor Don't use shortened names for variables
@Frondor I still see many large nodejs codebases that use var
15:32
cfg => config
@Frondor also, are you sure you want to have a static object defined on the object?
your argument is invalid
I don't know what vm is in this context.
whoops, i mean a static object defined on the class
static addHook (hk) {
    const hooks = this.$options.hooks || (this.$options.hooks = [])
Static methods cannot* have a this.
15:33
@towc and what is your argument to favor $ over _ for fake private properties? I'm curious
then any modification to $options will affect ALL instances of Person and that can get out of control quickly
@Frondor I'd rather you used neither
_ is more visually appealing to me
@Frondor if you're using ts, can't you just use the private keyword? I might be completely wrong
and sure, maybe vue uses $ to prefix internal variables, but they're anything but private
@MadaraUchiha viewmodel, its meant to be used within a model definition for MVV frameworks
15:34
@corvid it's not ts tho
@MadaraUchiha this is just the constuctor itself, right (assuming you call it FooClass.addHook())
@Frondor Call it viewModel then
@Luggage Sure but it's mighty confusing, hence the * on the cannot
angularjs also prefixes with $, but those things are so not private
15:35
i just use js as though private properties don't exist...because they don't xD
The way I deal with fake privates is its "enumerability" (if the word even exist)
(but that's a discussion for another day)
I use private variables as if they DO exist, even though they don't. I enjoy encapsulation through the power of my own willpower.
well.. that is to say, I don't use them outside wheren they should be.
@Luggage same
I never knew the profile popup showed chat activity over time
that's cool
I've found that most of the time private/protected variables just get in the way 90% of the time, even with C++. fortunately C++ offers plenty of encapsulation methods, js,well.....doesn't
i would use them when polishing code though. but during development it's just a pain in the ass, unless your design is really accurate from the get-go
anyway. _ > $ :p
15:39
To me, to declare a private property I just define it as not enumerable, so every time I do JSON.stringify(thatObject), they don't show up
the naming convention then is arguable, and depends on the dev team
I don't think if there's some linting option for that
oh wow, i didn't even know that existed
Frondor calls for aid
that's pretty cool. so there is some kind of implementation for true private properties, nice
private properties still aren't a thing in babel, huh? :/
I prefer to call them "fake privates" xD
15:42
the proposal was #property notation, accessible with this.#property
@johnmarinelli you can see that in action here https://codepen.io/Frondor/pen/BxpLZG
I've been playing around with some things and learn about that
15:54
@towc that looks like an ID
no u
guys, I just found a dataset with over 65million entries about deaths in PUBG
coordinates, killer name, victim name, match info...
@Neoares o_O 1) what is PUBG 2) where is this dataset
15:56
PUBG was a violent massacre, did you not go to school?
oh, it's a video game :<
disappointed?
immensely
@johnmarinelli in your universe, you just saved 65 million lives
Easy guys
15:58
@DavidKamer Ya.. but mainly structuring the project properly would avoid such questions about who does animations? or knowing.. in general who does what? For example in Angular project, John papa talks about design by feature vs design by layers(MVC), as shown here. I think we follow the same approach for stand alone applications or backend apps
@overexchange It was actually that everything was outdated on the github for the standard community package for react animation transitions.
I had to got the npm page and link to the react community website to get the correct information for version 2.
!!afk weeeeeee-kend
I understood the concept, it was that documentation was poorly organized.
HA
HAHA
16:04
see ya @Neoares
@towc you play pubg?
I am not sure if this it the right spot to ask this question. But currently I am trying to write some middleware that checks wether a JWT is valid or not before executing any async redux call. I am using react with redux and JWT to authenticate a user. I tried to make an as brief question in the SO community as possible.
If anybody has experience with refreshing a token automagically in react/javascript/redux, could you please have a look at my question? stackoverflow.com/questions/50176149/… love <3
I'd be surprised if towc plays anything.
@littlepootis same
I'm surprised towc makes it through the day sometimes
2
@rlemon Teach me to do that thing with the links so that I can go use it to Rebecca people in R11.
They're getting too crafty.
16:15
Ayee check npm dependencies again : blog.npmjs.org/post/173526807575/…
2
if an img is being requested, show an image, else redirect
@KevinB and...?
that is easy to spot :(
If an img is being requested render one with hotlink warning, too small text, maybe better
@ShrekOverflow Jesus. You have trouble during every offsite, don't you?
16:19
@SomeGuy The first one was flawless
Mexico was ok but I messed up with Canadian laws
This one is just special, since we haven't updated our advisory since 2014, I need to take a relatively dangerous vaccine or not travel or come back and live in 6 days of Isolation.
Why is it dangerous?
What's the isolation like?
@KevinVugts your thinking about it wrong here, you don't check the expiry on the JWT as that would require decoding it in the browser which would require your secret key. Rather your better off catching the error event that would be returned from the api once the token has reached it's expiry date.
@lix I am decoding it with a helper function I have created and it does work. ( the check works) but the timing isn't correct. I expected it to happen before any other call.
You could have an endpoint that would simply check if your authenticated but it wouldn't add really much more functionality. If your signing your jwt manually though it's a different story as you can read the expiry without having to decrpyt it, there's quite a few packages out there for that :-)
const parseJwt = (token) => {
  var base64Url = token.split(".")[1];
  var base64 = base64Url.replace("-", "+").replace("_", "/");
  return JSON.parse(window.atob(base64));
};
16:25
1 message moved to Trash can
@KevinVugts Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
Use ctrl + K on that snippet and it won't be moved :-)
There we go :-)
And yeah I did write it manually :)
Ahh I see, What does the rest of your middleware function or class look like?
I can share my project with you on codesandbox if you would like?
NH.
NH.
anyone with Chrome want to test this? crazy that FF and Edge have such different results: jsperf.com/array-prepending/1
16:27
It's likely your not using a promise or generator in your middleware so things are being called straight away
I can take a look sure
I am using promises for sure
1 sec Ill add it to sandbox
@lix can we go in a private chat?
@NH. What is your avatar?
http://gunsgeardaily.wpengine.com/springfield-armory-cuts-dicks-off/

Dat' title. (Not Rebecca)
16:32
What is it?!
have a nice weekend everyone \/
Is this regex unsafe [0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]{1,3})?Z?
What do you mean by unsafe?
user1596138
Always a good day when #17 is still here
is that a date?
16:40
It's my date
she's dead, Jim
every number could represent a point in time
Yeah, I am parsing WHOIS data, but it has a lot of different date formats
just look at Date
@Shmiddty some of which may be very bad days
... unsafe if you will
16:42
@Loktar pregtent?
!!> new Date(Math.random() * Number.MAX_SAFE_INTEGER | 0).toISOString()
@Shmiddty "1970-01-20T12:30:15.631Z"
I am searching for a date based on a likely header, then using regexes to try to detect the format, there are some cases where it just won't work though
user1596138
Why Number.MAX_SAFE_INTEGER | 0
Such as 01/02/2020
16:43
@Jhawins | 0 is the same as Math.floor
@jrtapsell Is that dd/mm or mm/dd?
user1596138
!!> Number.MAX_SAFE_INTEGER | 0
@Jhawins -1
@Shmiddty Nooo
user1596138
Is it?
16:44
hmm
@Shmiddty Noooo
It's truncation and conversion to 32-bit integer
@Zirak, exactly
user1596138
I don't really know my bitwise ops
user1596138
But yea I didn't think it would be floor
16:44
@jrtapsell rip you
!!> console.log(2.9 | 0, Math.floor(2.9))
@Shmiddty "undefined" Logged: 2,2
@Jhawins Operator precedence (* is evaluated first)
Tell me about it, I was thinking I might have a big list of TLDs with their WHOIS format, but that would be fragile
And I don't want to register a domain in every TLD for testing
XD
Plus I tried to use the whois package, which freezes on some domains
correction: |0 can perform the same operation as Math.floor under certain circumstances
user1596138
16:47
@copy Well right but either way
user1596138
!!> Math.random() * Number.MAX_SAFE_INTEGER | 0
@Jhawins -867712557
user1596138
lmao
It doesn't work well for timestamps because most timestamps don't fit into a signed 32-bit integer
user1596138
I don't know what Math.random output so now I have no idea
16:49
Codacy doesn't like my regex
!!> Math.random() * 2 ** 31 | 0
@KendallFrey 1838347663
I understand if it would accept really long input, but it's pretty restrictive
@Jhawins -ve numbers
!!> -1 | 0
@ShrekOverflow -1
16:53
!!> -2 | 0
@ShrekOverflow -2
user1596138
!!> crypto
@Jhawins {}
May LaForge be with you, y’all...
!!> crypto.subtleCrypto
16:57
@ShrekOverflow "undefined"
user1596138
!!> crypto.subtle
@Jhawins {}
yeah I done goofed
Anyone know a good chiclet key keyboard that's good for programming?
Feature request caprica should resolve promises
@corvid Macbook Pro
or any laptop in that price tag
17:00
Buy a whole laptop just for the keyboard? I have a macbook pro the keys are already degrading
@corvid D: what did you, wait why are you buying a keyboard for a laptop? and if you are why not a mechanical ?
also surface keyboard (not the laptop) is a good one
!!> crypto.getRandomValues(32)
@ShrekOverflow "TypeError: Argument 1 of Crypto.getRandomValues is not an object."
// crypto.getRandomValues(32) can't get this from cap 😬
wait wrong crypto, I should goto bed
!!> window.crypto.getRandomValues(new Uint32Array(1e3));
@ShrekOverflow "ReferenceError: window is not defined"
17:04
@ShrekOverflow Mechanicals seem to always have a lot of distance between keyup and actuation
In b4 I get sandbox'ed
hi
@John Welcome to the JavaScript chat! Please review the room rules. Please don'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.
@corvid and that is bad because?
Just doesn't feel good to me, purely personal preference
17:05
I use a mechancial keyboard and love it, its longer distance is actually veyr hard to feel
as we are talking mms
user1596138
> The InSight lander will make contact on the Martian equator and dig deep down into the planet to examine its inner core
user1596138
Is 5 meters "deep down"? I don't speak europe
!!> crypto.getRandomValues(new Uint32Array(1e3));
@ShrekOverflow {"0":2841152576,"1":2116313139,"2":3489921798,"3":1850458201,"4":3619319439,"5"‌​:3366553114,"6":1067017945,"7":2510677587,"8":3712657771,"9":3559700561,"10":3113‌​465444,"11":689411584,"12":2357986894,"13":1907459512,"14":4178521934,"15":527499‌​039,"16":3860676256,"17":3171461729,"18":2397704230,"19":2012451482,"20":84215744‌​9,"21":1876085791,"22":1131004131,"23":3323885966,"24":2855695216,"25":2669307 (snip)
17:06
Mwahahahaha
NH.
NH.
@Loktar I scribbled it on a pressure-and-heat-sensing pad. see my profile desc.
ahhh ok
> And if you are curious, my profile picture is usually a Gravatar of something between an "n" and an "h".
I always felt like my blackwidow ultimate keyboard made me fingers feel very uncomfortable over extended periods
lmao I was curious.. just went to your chat profile, not your main one ;p
I think some major bug hit many big companies out there and caused plain text passwords to be outputted to logs
Friend of mine got an email from GitHub, and I got an email from Twitter saying basically the same thing
17:09
Shite
@MadaraUchiha That story is so yesterday
@corvid blackwidow is not what I'd call a good mechanical keyboard
^ lol what @copy said
but in that case Microsoft Surface
is a good keyboard
17:09
they're overreacting a bit too, iirc the amount of users was incredibly small
@copy Hahaha, why does @copy sound very basic here? :P
I'm imagining you flipping your hair and everything. It's so yesterday!
@Loktar 330 M is small?
> "During the course of regular auditing, GitHub discovered that a recently introduced bug exposed a small number of users' passwords to our internal logging system," said the email, received by some users.

The email said that a handful of GitHub staff could have seen those passwords -- and that it's "unlikely" that any GitHub staff accessed the site's internal logs.
> May 1, 2018
user1596138
@corvid That's how all mechs feel to me.
21 hours ago, by Ben Fortune
user image
17:12
@Jhawins Uh, I just ordered my first mech. Hope that's not gonna happen to me :o
Which switches did you have?
user1596138
Hey @Shrek do you have the matching mouse to my Surface Keyboard
And I ordered it specifically to improve ergonomics :o
@copy Right, and Twitter happened to have the exact same bug?
user1596138
@SomeGuy I love love chiclets. Don't listen to me
> About The Bug

We mask passwords through a process called hashing using a function known as bcrypt, which replaces the actual password with a random set of numbers and letters that are stored in Twitter's system. This allows our systems to validate your account credentials without revealing your password. This is an industry standard.

Due to a bug, passwords were written to an internal log before completing the hashing process. We found this error ourselves, removed the passwords, and are implementing plans to prevent this bug from happening again.
17:13
21 hours ago, by Ben Fortune
@KendallFrey what the fuck, isn't that exactly what github did?
user1596138
amazon.com/dp/B01MQ0SB7Z I use this and love it
Haha, honestly, I enjoyed chiclets too, but not enough to be my primary
> which replaces the actual password with a random set of numbers and letters
user1596138
I've been using them for 6 years full time
user1596138
First 4 were with those white corded Apple keyboard. THen I got this over a year ago
17:14
@copy Yeah, well, they tried to be nice about it and explain it to the less technically inclined.
@MadaraUchiha Still though
@SomeGuy depends on the mechanical / mem-chanical keyboard
Mem-chanical?
Membrane?
almost 50% of them on market are sitty and 80% listed as mechanical as membrane keyboards with some mechanical aspects
or rip-off keyswitches
add to that they are specific to people 😃
Madara, copy down for playing some matches in overwatch tonight?
17:17
!!> crypto.getRandomValues(new Uint32Array(1))[0] > (Math.random() * 2 ** 32)
@ShrekOverflow false
user1596138
Wat? Anyone used this
@Jhawins it is like apple's magic mouse from msft, do not recommend, tried it, was gimmicky
they have better mice
user1596138
It bends?
17:18
kinda
user1596138
Oh dude I hate magic mouse
user1596138
I have 1 still
but not really active position isn't flexible enough
Looks like an inch worm
when on its an arch
@Jhawins if you want a ergonomic mouse, look at Logitech MX2
user1596138
17:18
I just thought it looked bizarre
user1596138
I am fine with a $5 junk bin mouse.
Then lemme grab you one from India xD
$5 literally!
user1596138
$500 shipping
I bought a mouse for $1 yesterday.
I might be coming to states in 17 days
17:20
"free! with $40 shipping"
@forresthopkinsa no in India you can actually buy one at that rate
user1596138
I did think about getting this one tho amazon.com/Microsoft-Surface-Precision-Mouse-Light/dp/…
user1596138
@ShrekOverflow Nice. Where to
@Jhawins Seattle
So chat needs rooms
too many tabs error
NH.
NH.
@ShrekOverflow lol @ your username! 🤣
17:25
The credit goes to this room
NH.
NH.
really?
they came up with it?
@ShrekOverflow old mechanicals, like buckling spring, used membranes, too
@ShrekOverflow I take all the credit
NH.
NH.
!!> window.location.href
@NH. "ReferenceError: window is not defined"
NH.
NH.
17:29
oh snip
@Luggage not rubber domes though
the rubber domes are the ones that usually hurt fingers and give you strain the most
user1596138
Anyone have a "arozzi verona pro"
user1596138
They're $150 on massdrop with free shipping
user1596138
@Loktar?
user1596138
17:37
Ahh looks like there's a V2 now, prob explains the price
user1596138
Bah I need to stop shopping and work lol
17:52
!!> crypto.getRandomValues(new Uint32Array(1))[0] > (Math.random() * 2 ** 32)
@ShrekOverflow true
user2620028
@ShrekOverflow get you some
@HatterisMad ?
user2620028
@ShrekOverflow XD
user2620028
how do i not have you on discord
user2620028
17:54
probably because you are still stuck in the world of skype?

« first day (2757 days earlier)      last day (2414 days later) »