« first day (2823 days earlier)      last day (2123 days later) » 

6:06 PM
wait, archer season 9 ends with episode 8? 😒
 
@towc half life 3 confirmed
 
I'm back :p
Another day...another question
 
ohh yea, I should have done that
 
gotchu bae
 
6:12 PM
Question: I need a way to make a video toggle full screen after an AJAX request. (Basically, AJAX request will return JSON with a certain control: play, pause, volume up/down, or toggle full screen. )The others were easy, but the problem is browsers don't allow things to go in or out of full screen unless theres an event. Is there anyway to fix this?
 
what triggers the AJAX request? Can you latch on to that?
 
user1596138
Does the user click something that says full screen?
 
user1596138
If not no. If yes, go full screen when they click it and modify the video in the background
 
The AJAX is a constant request with a setInterval()
 
you're trying to set to full screen every few seconds??
 
user1596138
6:14 PM
Then the answer is no. The user will need to choose to go full screen
 
@Jhawins Well sorta...
 
user1596138
Is it easy to explain why? Because this sounds like a spam site
 
there are very few ways to violate user trust like trying to go fullscreen without permission
 
@JBis why in a setInterval?
 
The idea is that there is a computer (connected to a projector) playing a vid on a website. There is a second page on the site where you go on your mobile phone. It acts as a remote. When you press an icon on mobile it changes the AJAX to the control.
 
6:15 PM
you're aware that will open up situations where you have stacked timer calls
 
?
 
setInterval( () => {
   longAjaxCallThatTakesMoreThan1000ms();
}, 1000);
if your call gets delayed, or is long running, you'll make the next call before the first responds
 
backpressure man lol
 
I have implemented pretty well (I think). It works for all other controls.
 
user1596138
Wouldn't it be easier to actually control the remote....
 
6:17 PM
well, I disagree. ajax in a setInterval just reeks of 'I need to pay attention here'
 
@JBis I don't think the general architecture here is optimal for your goals
 
function makeCall() {
  setTimeout( () => {
    ajax().then(makeCall);
  }, delay);
}
 
So then what do you suggest
 
then you cannot have stacking calls.
probably not your issue, but I saw it
 
Hold on....confused
I don't get the issue with using constant AJAX requests (besides the inefficacy and bandwidth use)
 
6:19 PM
a lot of issues that may or may not be issues
 
for one thing, if you want to keep doing it this way (since it seems you've already finished a lot of this app) the solution isn't really that difficult. Since you have control over the user environment (!!) you can just set the browser on the projector to fullscreen and use your AJAX calls to change the size of the video within the viewport
right?
 
I mean, you could exhaust memory, you could trigger their ISP to rate limit them, you could trigger a firewall rule because of the 'spam', etc.
but this isn't your actual issue, for fullscreen
just a tip
 
@forresthopkinsa Ok. I am also using it on a TV with a webrowser.
 
but either way you can still just keep the browser itself in fullscreen, no?
 
So settinging the viewport I don't think will work
 
6:22 PM
I'm saying, change the size of the video to 100vh
or fixed/100% whatever, you get it
 
But you still have the browser
like buttons, tabs, etc.
 
wouldn't you just to call video.requestFullscreen() ??
 
dude, that's why I'm saying, set the browser to full screen when going to the site
 
@rlemon Yes! But it only works if there is certain events calling it (eg onclick)
 
says who?
oic, it has to be requested in an interaction
 
6:24 PM
Yes
 
makes sense. would be easy to make a phishing attack otherwise
 
Yup
 
so looks like you're going to have to provide them with a button to click
 
like the new video-autoplay restrictions
 
But then it defeats the purpose of a remote
 
6:25 PM
well, the alternative is opening up the browser to malice
 
what's wrong with the solution I presented
 
@forresthopkinsa doesn't mimic a F11
 
when you set a browser to fullscreen mode, the website you're viewing takes up the entire screen
 
Theres no full screen mode
 
no window frame, no browser buttons, etc
 
6:26 PM
but you can't do that programatically
can you?
 
user1596138
@forresthopkinsa Seems reasonable to me.
 
Yeah
 
no but that's the thing @rlemon he is in control of the environment here
 
ohh
I don't know the full scenario
 
I don't have control over the TV browser.
 
6:27 PM
explain
you've made it sound like this is for internal use. Is this being distributed?
 
user1596138
Regardless, you will not be triggering a full screen event via noticing a property updates on your server on a setInterval ajax call
 
The TV browser is powered by Chromium.
 
user1596138
it just isn't going to happen.
 
Its internal.
 
user1596138
Oh
 
user1596138
6:27 PM
So go disable the security
 
Can't
 
user1596138
...
 
I didn't program it. Its made by LG.
 
come on man
you're telling me the webOS browser doesn't have a fullscreen mode
 
@forresthopkinsa it might not.
webos sucks
 
Maybe it does.
Ok.
 
I agree webos sucks but it looks like this should work
 
I don't mind my tv OS, but there is a shit tonne of room for improvement
 
Scratch that it does have a full screen,.
 
user1596138
Wait how is it not always full screen anyway
 
6:29 PM
no kidding
 
user1596138
At most you have like a little bar at the top
 
he wants borderless fullscreen
basically, F11
 
But it doesn't change the fact that the video is not actually full screen
 
user1596138
Well with his proposed arch, it isn't going to happen
 
Ok.
 
user1596138
6:30 PM
The user will have to trigger it.
 
Fine. I'll accept no solution for this.
 
@JBis your solution is put a button on the page
 
why not? if webos browser is in true fullscreen mode then why isn't it fullscreen??
 
that is the solution
 
user1596138
Why can't you pop up a modal that says "accept full screen?" and have them click Enter on the remote
 
6:30 PM
^
 
user1596138
There's plenty of solutions. You can't do what you said tho
 
There two remotes
The fake one (mobile website) and the real one (LG tv remote)
 
I mean, the ultimate solution is to make this a native app for the TV
 
user1596138
Better yet: Why not use the remote
 
then you're not limited to the web standards
 
6:31 PM
Because the remote is a pain in the ass to navigate
 
if you want to ride the webpage route, you'll have to deal with security concerns.
 
Ok.
 
user1596138
You know what's a pain in the ass to navigate? XY problemz
 
lolll
honestly, if webOS browser is in fullscreen mode, then you don't have a browser bar. Then you set your video to absolute positioning and 100% w/h and voila. Either you're not understanding me or I'm not understanding you here
 
user1596138
I have an LG TV
 
user1596138
6:33 PM
I could just see what it does
 
yes please sir
 
user1596138
But then so could he...
 
Ok. Fair enough. I will test that an come back.
 
I have a LG tv.. at home
 
same @rlemon
 
user1596138
6:33 PM
 
I also have a second issue. (Hopefully slightly less annoying)
 
user1596138
So quick google reveals it running in absolute full screen
 
Ok.
 
so what's the issue then
problem solved man
 
user1596138
Idk I found some of both
 
6:34 PM
the support page I pasted earlier says you can go in or out of fullscreen
 
user1596138
Either way the question at hand is: Can I go full screen with no user interaction.
Answer: No.
 
user1596138
Next pls
 
yeah what's the second issue
 
The website has videos on it (duhh). In an attempt to allow resuming of the videos later (so they will automatically resume video if they close and reload browser, similar to netflix), I have a constant (yes again) cookie updater. It runs using the ontimeupdate event. Every time that event is updated it sets a cookie with the current time. When the page reloads it checks if that cookie exists. If it is it will set the video to that time with currentTime=.
It works great without problems, but I feel like there should be a more efficient way of doing that.
Is there a better way to implement this?
P.S. Sorry if I pissed anyone off. A bit new to a lot of this (programing web languages) (started couple months ago).
 
yea, don't use cookies :D
there is a localStorage that doesn't get handed back and fourth with the server
 
6:41 PM
So basically the same thing but with localStorage?
 
yup
 
Ok. Well that was easy.
@forresthopkinsa @rlemon @Jhawins Thanks for your help! (And sorry for my stupidity).
 
don't worry about it
 
:)
 
7:03 PM
Any ideas on how to reload a .env file without reloading the entire node server. Couldn't find any related questions. Easier implementation the better
I'm using express
stackoverflow.com/questions/24750395/… but nodemon must not be seeing the change? I'm using nodemon already and it didn't restart in test environment
 
4 year old node answers are almost always wrong today
 
plus I don't want to restart the server as is mentioned in the questions comments somewhere
 
and if they are not outright wrong, they're on very old tech
 
yep. any ideas?
 
you could re-assign process.env[x] I guess.
but I don't know of anything that does that without reloading the server
if you know of a lib that watches files for changes, you can do it programatically in the server.
watch(file).on('change', () => {
  // parse file
  // re-assign process.env
});
 
7:07 PM
that's what I want to do. I was thinking that it would only take a few lines and thought maybe there is an express module that could handle it specifically.
 
but anything instantiated with the old environment will stay that way
nothing is automatic
the easiest solution is to just restart the server
I can't think of many reasons to want to not restart the server tho.
setup a session store, and everything will probably chug along like normal
-2
Q: First time on ReactJS

Zain MohsinHey I'm learning ReactJs these days. As a starter, I don't know which extensions might be useful. I'm working on VS Code. By default its giving me these types of syntax errors: Can someone recommend me some useful extensions for React on VS Code?

 
@rlemon good point. I have sockets running on my server though, but it actually shouldn't matter too much because I think I've observed sockets.io automatically reconnect a client when nodemon has restarted in the past. Can you think of a way to get nodemon to restart when the .env changes? Also, have you ever used Nodemon in production?
 
never used nodemon
try forever.js
 
@rlemon oh. Has it worked well for you in production?
 
yes
I don't live reload tho
but I know it is a feature in forever
 
7:14 PM
nodemon's been a blessing for local docker-compose development
 
@rlemon might not be JavaScript related, but tangential: why would file watchers on an Ubuntu system not see changes to a hidden file?
 
no clue
 
@DavidKamer they do. Your tool probably needs to be configured accordingly
 
he's asking why wouldn't it see the file, not does it see the file normally.
so clearly, it isn't configured proper
 
because of config
 
7:15 PM
thanks tips
lol
 
what's that a reference to?
 
you stating the obvious
 
no u
 
@towc then that's what I'm asking.
 
@DavidKamer well, depends on the tool then
again, obvious
 
7:17 PM
@DavidKamer an easy confirmation would be to try another tool, life forever, and see if it works.
 
but just in case you're not getting that your question is hardly answerable
 
if it does, you can blame nodemon
 
but let me take this back a step. Is there a better way to approach changing your server side secret for auth with jwt?
 
if not, you're back to looking for solutions
 
or does it even matter to change it regularly?
 
7:18 PM
do you generate your keys?
 
@towc yeah, but I had no way to know. I've only used nodemon for this.
 
or manually enter them
 
@DavidKamer that's fine. That's why I'm asking
the "again, obvious" was a rlemon-repellant
 
@rlemon I will randomly generate in production. Probably using a different tool in the system with Python
 
then pull the key into memory from the script you use to generate it
every N days or w/e
I'm using JWTs but I don't fully understand it all, so I'm not sure if you have to re-issue to the clients at that point
 
7:20 PM
@towc lol, I thought you meant towards me. My system's engineering skills on Linux is still child like sometimes compared to other stuff. I have a bad problem with too much generalized knowledge sometimes
@rlemon yeah, I just have the client log out the client app by removing from localStorage and redux store and letting a redirecting component put them on the landing page. That is actually a brilliant idea, but I'm worried that it is a bridge-made-of-toothpicks-for-a-semi-truck type solution. I like when things are based on files because seg faults and such don't have as bad of a repercussion that way. Maybe just paranoia, but I log file changes in production heavily.
*file access
 
I avoid IO whenever possible.
 
I basically want my key generation to shit in a file so that the two programs don't touch
 
sure, so write it out to a file, and read it in node
 
I'll only regenerate every x days
 
if you're generating on a schedule, you don't need a watcher
you just need to tell the server to look at the file ever N days
 
7:24 PM
I want to avoid the possibility of constant reloads of my secret, but I'm sure it's possible. A pipeline would make me worry though.
@rlemon I thought you were talking about making a Python program that has a pipeline with node to get the secret?
passing it directly from memory?
 
well, you can do either.
python -> pipe -> node
python -> file -> node
 
I could do a pipe that tells it when to reload the file. That would make it so that I don't have randomly new secrets popping up with some kind of bug but also make it so the system controls it not node.
 
well, when you make node react to the file changing, you are taking it out of nodes control
ohh, sorry, you want that
I misread
 
yeah, I'm just trying to figure out a way to avoid as much potential hassle as possible and letting node control something could be bad if upload changes and restart the server. Them x amount of time will just restart.
 
7:59 PM
bought airpods, feel bad for the money and how spoilt I am.
 
shameful
 
Although with 3 work owned apple devices, I think its an OK investment
because I can't have a corded headphone that works with both unless I glue adapters to it
 
being tethered isn't all bad.
 
I like cords
 
If I'm at a desk, I don't have any issues with wired kb, mouse, headphones, etc.
 
8:03 PM
I am tethered to my lovely girlfriend forever, no more tethers
 
I like reasonable prices
 
Faster
 
they're a lot more reliable
 
Yup
 
lol, faster.
 
8:03 PM
@forresthopkinsa They are actually cheaper than a worse quality headfarts
I do also have my M50x's
 
unless you're like the #1 FPS player, input lag probably isn't even noticed in day-2-day work
 
@rlemon about 3 seeconds of playback lag on video is definitely felt
 
yeah I'm sure there are always even worse options
 
yea, 3 seconds on video
 
@rlemon What?! Faster is true. Ethernet vs WiFi
 
8:04 PM
that has a lot of other factors.
 
@JBis Way different convo
 
in my house, WiFi is sometimes faster
but we're talking accessories
 
Depends on Cord Length/ Quality/ Degree in Network Engineering
 
kb, mouse, headphones, etc.
 
Idk how thats possible
 
8:04 PM
you're not noticing lag there
@JBis 5G vs wonky switch
 
just because you can get a $300 pair of Beats that are worth about $8 doesn't make the Airpods a good deal LOL
 
5G vs Just bad network setup
Setting up ethernet is an art
 
my switch does weird things with balancing
 
setting up wifi is plug and play
(the irony)
 
I have Beats but got them for free :) So they were worth it.
 
8:05 PM
@JBis darn
 
best headphones I've ever had are some $90 Sony ones
ZX660s
 
I got my Macbook, iPad Pro, Pencil and AirPods for free
so they are all worth it? (I don't think so)
 
I am an Apple fan soo....
Although AirPods are stupid
And so is the butterfly keyboard that I am typing on
 
ah gosh you guys
 
and so is iOS 11
and so is the touchbar
 
8:07 PM
> I'm a fan of Apple, I just hate their input devices and OS
lol
so.. you like the screen?
 
MacOS is better for most of my work vOv
 
olive oil is better
 
that is the reason what keeps me stuck to mac
 
and so is the fact that if you want a maxed out MacBook Pro you get charged the extra $100 for a Touch Bar they you don't want nor need
 
I'd switch to Linux
@JBis TouchBar is good if you use it sanely
 
8:08 PM
I'm happy on linux for work 95% of the time
 
I have been using it and can't go back
 
not $100 good
 
@rlemon Half the tools we use don't work on linux or have severe issues + securing linux is very very hard for > 500 people (unless you have a team of 30+ IT people).
 
well, I reject your security issue. but compatibility might be true
 
I'm thinking of buying a mac, there are good quality at the end of the day
 
8:09 PM
and so is the facts they randomly take things away that some people use (coughs cough macOS Server, iMessage Apple Script Handlers, Cookie resicpe hidden in macOS file system)
 
@rlemon GUI Isolation is still a nada on linux
 
however, I've not had almost any issues with software compatibility
 
even with XWayland 😃
 
I like Kali Linux
 
@rlemon You are a dev, I am a sales engineer.
 
8:09 PM
and the difference is?
 
Hate windows.
My god
Like get a Unix terminal.
 
I don't mind windows. but 10 confuses me
I haven't used it much
 
Command Prompt is legit useless
 
I don't mind windows, its a good OS for gaming only.
 
Lol everyone says that
The only reason it is good for gaming is because game companies make their games for windows
 
8:11 PM
@rlemon There is a tad bit more stability etc (including on Google Chrome)
 
eh
 
@rlemon Are you using X Server 😃 ?
@JBis no, its Direct X
and more consumers on Windows
 
But we all can admit that Apple products are by far the safesst
 
hell no
 
8:12 PM
yes
and yes
 
Nothing is secure
@JBis I work for an Authentication Provider, and we go with nothing is secure by default 😃 .
 
But it is the safest
Thinks about it
SIP
 
@JBis I wouldn't put my money on it
 
@ShrekOverflow Well thats a givven
 
a few months (well probably a year and half) ago you could get all passwords from keychain
using a program running with normal user privilages
(ofcourse non-sandboxed)
 
8:14 PM
Well first off High Sierra + iOS 11 was a big fail so don't count those
 
also remember the root password blunder 😃
@JBis You don't get to say that in security
 
second off all systems have glitches but in general apple products are very safe
 
it speaks of a bigger problem at the highest levels
@JBis No, stuff like not setting a root password or not disabling root login is a brain fart.
 
a couple years ago, the annual CVE report's TOP TWO most vulnerable softwares were Mac OS and iOS
they were more vulnerable than IE and Adobe Flash
 
Then again IE is IE.
 
8:15 PM
CVEs are reported
 
there's a yearly roundup
 
@JBis trust me, Apple products are just better thoguht and safe because of the restrictions.
if you are using Google Chrome on MacOS then you aren't as secure as apple advertises
 
@forresthopkinsa yea, and for a good while there IE was the most secure browser :D
we tend to forget that IE6 was the most innovative browser from its time
 
Edge is still extremely innovative
 
it just lacked updates for way too long
 
8:17 PM
the windows spaces feature is fucking smart
 
Edge isn't an awful browser
 
it just lost so much of the market to Google Chrome because of how long it took
 
@JBis It is an awful browser, an innovative but awful browser.
 
And chrome works arrcoss all platforms
@ShrekOverflow Well in comparison to IE
 
8:19 PM
makes sense
I wish Edge was available on MacOS too
 
Bleh
 
@JBis It'd make testing easy, its for the good of the web
 
Safari is a decent browser
Not as good as chrome
but still very competitive
 
user1596138
lol
 
Disagree?
 
user1596138
8:20 PM
Yessum
 
I think Safari is trash but it does make good use of system resources
 
Well the 2 biggest problems with safari is consistency, and extensions.
 
!!s/safari/browsers today/
 
@rlemon Well the 2 biggest problems with browsers today is consistency, and extensions. (source)
 
Safari just decides to fail at some points for no reason
But overall
I think that Linux is the best for semi to advanced computer users, macOS is best for everyone else, windows is best for gaming.
But I would run linux as dual boot on mac
 
8:28 PM
@Shmiddty ping rlemon on steam
 
@Shmiddty or on hangouts
thanks :smoochies:
 
Goodbye
good talk
cya
 
@JBis Don't
there is 0 advantage
unless you really like using apt, aur, pacman, dnf, yum to install things or just hate BSD.
 
or if you like having really deep control over your system
 
or if you just want both OSs
don't boot shame @ShrekOverflow
 
8:34 PM
I am not boot shaming, I don't see a point in dualbooting on a macbook, unless you are dual booting to windows.
 
I think 'hating bsd' is a great reason on its own
 
@forresthopkinsa you have the same access on Mac
I am currently writing a Tun Tap virtual device, it was the same experience on both mac / linux although a custom driver needed to be installed on Mac
 
Back for a sec
 
what about installing different display servers or window managers
what if I want AwesomeWM on mac os
 
Not entirely on topic here but here's my question from my home site AskDifferent. 100 rep bounty. Has to do a bit with JavaScript MAYBE you guys can help
3
Q: Prevent Spam Downloads on Safari

JBisBackground A new spam page has started to appear throughout many "questionable" sites (movie sites, etc.). This new spam page fits in to the category of fake scans, MacKeeper, "YOU HAVE A VIRUS", etc. category. Problem The problem with this new page is that instead of just having a popup, th...

P.S. Its applicable to all browsers not just Safari
 
8:44 PM
@rlemon is it party time?
 
user1596138
@JBis So why did you ask on apple.SE haha
 
user1596138
That's some low level shit, we can't block that with JS
 
don't know why the browser doesn't automatically debounce download attempts
seems like a no-brainer
 
user1596138
I'm sure there's bugs in the issue trackers already
 
user1596138
If you really want it fixed go there, star them/interact with them
 

« first day (2823 days earlier)      last day (2123 days later) »