« first day (3839 days earlier)      last day (1092 days later) » 
01:00 - 12:0012:00 - 22:00

1:45 AM
 
 
1 hour later…
3:11 AM
^ wat
 
3:37 AM
@JBis probably some pro/con of going to mars
 
4:36 AM
Bah, and the screen on it ended up being dead after a few hours :(
glad I got it on Amazon at least I can return it
 
5:12 AM
posted on April 20, 2021 by Krishna Govind

Hi, everyone! We've just released Chrome 90 (90.0.4430.82) for Android: it'll become available on Google Play over the next few weeks. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Krishna Govind Google Chrome

 
5:35 AM
@Loktar oof
 
 
1 hour later…
6:46 AM
hello. anyone here?
 
7:35 AM
trying to do a redirect from my backend service which is in nodejs
my frontEnd is in angular
res.setHeader('Location', `google.com`);
have tried the below as well
res.header('Access-Control-Allow-Origin', req.headers.origin || '*');
res.header('Access-Control-Allow-Methods', GET,POST,PUT,HEAD,DELETE,OPTIONS');
res.header('Access-Control-Allow-Headers', 'content-Type,x-requested-with');
res.writeHead(301, {Location: 'http://google.com/'});
res.end();
 
 
1 hour later…
8:41 AM
The latter would work with any browser, except obviously not during ajax calls.
If this is due to an ajax call I'd just send a special code - and on the frontend push to the history.
 
9:07 AM
@paul23 its not a ajax call, basically its a post call and based on certain logic I'm making it to redirect on the UI
 
uhhh I hav a hard time imagining how you would do a "post call" without ajax
 
 
2 hours later…
11:01 AM
Mornin'
o/
 
Hi Everyone, Im looking over some elses SHIT code and cant even find an example on MDN that shows this type of use. Has anyone ever seen curly brackets used inside splice() like this? And what is he trying to do??
json.B.splice(0,0, {"A":"-"});
Im trying to think through this idiots logic
Here's another which I deemed as "He's an Idiot"
if (typeof(json.B.push)!=='function') {json.B=[json.B];}
Whats that push doing there with nothing to push?
If anyone could shed some light on these 2 things Id be most grateful as maybe Im missing something...
 
@Stuart Theres nothing idiot about it
its simple
hes placing an object into the array
 
Ohhh
 
hi everyone
 
11:10 AM
@PervizPirizade Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
@MisterSirCode Yea I looked at that b4 coming here and didnt see any examples of inserting an object
 
||> ["hello", "world"].splice(0, 0, { "foo": "bar" })
 
@MisterSirCode [] Logged: `` Took: 0ms
 
What about push having nothing in it here? if (typeof(json.B.push)!=='function') {json.B=[json.B];}
 
11:13 AM
@Stuart thats checking if its an array
though.... I dont know why
 
Shouldnt that be if (typeof(json.B)!=='function') {json.B=[json.B];}?
 
you could just typeof json.b == "array"
@Stuart no, because then youre checking for an array
 
I call him an idiot because I see lots of this type of use and he is even using eval() in the code
 
see, if json.B is not an array, .push() will return undefined
it wont be a valid function
 
Ohhh
 
11:14 AM
but if json.b IS an array, .push() will be an acceptable method
again, you could just check if json.b is an array / object
so Im not sure why theyre doing that
I guess its a shortcut
so they dont have to check if its an array or an object
weird method, but I guess it does work
 
I see alot of un ideal code
 
@Stuart well, not everyone follows the JS standard
and... just looking at json.B I can tell their variables are bad
 
A programmer checking for the existence of push only does that because he's unaware he can just check the type...
 
Are you sure that this is right? if (typeof(json.B.push)!=='function') {json.B=[json.B];}
Seems that push shouldnt be there
 
Its intentional
again, if you remove push, that if statement wont work
 
11:17 AM
Hmmmmm
 
if (!(json.B instanceof Array)) {json.B=[json.B];}
 
@Cerbrus Its possible they expect json.B to output either an array OR an object, so instead of checking for both, they used that to shortcut it
 
Well Thank You for enlightening me
 
@MisterSirCode I strongly doubt they put that much thought into it... End even then it's a horrible approach
 
hey, just a thought
who knows
 
11:19 AM
+1 @Cerbrus
This guy even uses eval()
 
(I personally prefer instanceof, as that ain't using strings to compare types)
Do you have an eval example? I bet we can fix that not to use eval
 
I think Ive only used eval once in production code... it was for a discord bot... a private command only I could use, that would allow me to parse quick JS commands
other than that, Ive never used it
 
Well its not real important but here's another unrelated example of the same guys code for you to get a kick out of
 
*Prepares eye bleach*
 
ALL This instead of one line setinterval() anddddddd another eval()
LOL @Cerbrus
function loadTimer() {
	var JSONURL;
		JSONURL='/javascript/timer.json?R='+new Date().getTime();
		$.getJSON(JSONURL, function(json) {
			eval(json);
			try {
				if (json) {
					if (json.A===undefined) {
						return false;
					} else {
						varTimerOn=parseInt(json.A,10);
						var JSONval=parseInt(json.B,10);
						var XMLval=parseInt(json.C,10);
						if (varTimerOn===1) {
							window.clearInterval(varJSONint);
							window.clearInterval(varXMLint);
							varJSONint=null;
							varXMLint=null;
 
11:22 AM
what... the... fuck?
 
RIGHT
 
god those variable names... A B C
and all those intervals
 
That too
 
if (varDebug==="Y") { Who needs booleans right?
 
11:23 AM
I figured yall would like that
 
Like it?
No.. it needs to burn
 
Please tell me the dude doesn't write code any more
 
lol
 
To me, it sounds like someone who self tought and never got / took any judgement / reflection towards his code
Id know because I used to be like that
but I've taken advice from people here over the years
 
Oh man almost all his variables are globals
 
11:26 AM
This is only a sampling
of what Im wading through
 
How did that project come into existence?
 
I figured yall would like that === sarcasm btw
 
How is it even functioning?
 
idk
 
Actually, IS it even functioning?
 
11:27 AM
Thats the big question
 
Believe it or not... Yes
Are yall sitting down?
 
meh, it didnt look that bad in terms of functionality, its just breaking a lot of rules
and it just murders variable standards
 
@Stuart that's 95% of my job xD
 
"Ah yes me too lazy to make da json variables, so I go with A B C"
 
How about this inside of <ul><li's>
 
11:28 AM
^ If even he thinks it murders standards... xD
 
@Cerbrus Isnt that how most self tought learners are though?
I used to be like that, super arrogant, barely took advice
sometimes I can still be that way :3
 
There isn't a tutorial out there that teaches that style of programming
 
Exactly
 
Not necessarily @MisterSirCode Im self taught and none of my code has ever looked this bad
 
11:29 AM
@Stuart That's actually kinda impressively consistent layout
impressive for all the wrong reasons, but still
 
This guy is very arrogant
I dont find tabular data inside li's impressive at all
 
Oh man, that mobile / desktop switch...
 
unless you're referring to impressively ignorant
 
@Stuart Well thats likely because of where and how you learned
I learned from stealing code and wrapping other's content half a decade ago
until I got bored of that and actually tried to understand it
 
tabular data belongs in a table period
I must understand everything otherwise I hang like my computer does so frequently
 
11:32 AM
Oh I see, he's reloading that "table" every x seconds
 
Its not a table
 
fixed
 
hahaha
 
Meanwhile, to style the odd / even rows, he's added "even" / "odd" classnames to the rows...
 
rofl
 
11:33 AM
instead of just using the css pseudoclass
 
right...
Id be a lot kinder to him had he not turned his nose up at me
 
Oh geez... The classnames on those "table cells"
 
Ohhhhh I forgot lemme find you another example
 
a n c l bg llw blw in pit h s my and last but not least, a descriptive one: rider-notselected
 
You'll like this
$("#results").removeClass("hideresults").addClass("hideresults");
and another
 
11:36 AM
for one... jquery
 
... why
 
for two... thats contradictory
its useless code
 
$("#results").removeClass("hide").addClass("hide");
 
delete
bad
 
Thats what I know
LOTS of this and arrogance on his part
Wanna hear a joke?
 
11:38 AM
jQuery is "shrug"... He's loading it from the CDN
what can be more of a joke than that code?
 
I responded to 4 craigslist ads labeled something to the effect of "Local Web Developer Seeking Work. 10 Years Experience" etc...
I contacted these people regarding some ES6 code Ive been struggling with
 
you... went to a job ad to get javascript support??
0 _ O
 
and one never wrote back, The others said: Oh sorry this is out of my scope, I mainly develop using wordpress and wix
Yea yea yea... I know... I just thought Id might run across someone smart to have coffee with at starbucks or what not
 
Yea... stuck building WP websites
 
LOCALLY
 
11:43 AM
Imagine being a programmer just for wordpress wix sites

What a sad empty life
 
didnt turnout like that
LMAOOOOO
Making my side hurt @MisterSirCode
 
Ive used WiX before out of curiosity...

Its more difficult and anoyying then just writing the CSS and HTML yourself
"oh yeah you cant select this image because you have free account"
 
Ive never used WP or WIX
Only Notepad++
 
Well SCREW YOU wix.... I can create as many <img tags as I WANT
 
Oh there's a limit on img tags?
Oh Mannnn
 
11:44 AM
I believe they have all sorts of limits
I tried it like 2 years ago, couldve changed by now
 
I bet
You should try SBI where I first began
100kb max image size
NO FTP
 
100kb?
 
One file at a time
 
damn
ouch
 
NO PHP
 
11:46 AM
Eh, php isnt that hard to go without
 
or any other language besides JS or jQuery
 
I only use PHP for admin pages and .htaccess stuff
@Stuart jQuery aint a language
 
Well at SBI you'd be SOL
 
its a barrier
you really shouldnt use it
 
Oh, Oh Yea... My bad
I try not to
no htaccess access
and $300 per year for hosting
 
11:48 AM
htaccess isnt really too useful unless you know how to use it
 
per YEAR
 
you have to understand the PHP ReGeX system
 
Its very useful
 
and understand how it interacts with the rewrites engine
heres a small section of my htaccess rewrites as an example
 
I dont understand the PHP ReGeX system but Ive modified my htaccess plenty to enable cache and 301's
 
11:49 AM
# Rewrite "https://www.mistersircode.com/..." to "https://mistersircode.com/..." if it exists
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ mistersircode.com$1 [R=301,L]

# Force https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
see how messy it is
its a pain
but, if you do understand it, it IS very useful
thats not even including my page rewrites
those ones are way worse
 
I do stay away from it now that its all setup
and I did get a good bit of help from my AWESOME hostiing provider
Not sure if it;s a security issue to reveal hosting provider name
probabaly not so here goes
InMotion Hosting CANNOT be beat
 
You know...
You could just run a Google Cloud F1 Micro VM
and run a website off of it
eternally for free
mine costs 4$ a month because I use quite a lot of google's APIs
but with just the F1 Micro and Google DNS
its free
or.... firebase
I dont like it as much anymore
but its gauranteed to be free
but its static, no PHP
 
InMotion is 200 for 2 years
Lil less than that
 
for me as a long term customer
 
11:55 AM
wtf
dude youre being scammed...
 
TWO Years
 
Im aware
 
100 per year
 
my website's domain is cheaper than that for 4 years
and hosting is free
 
Oh No... Thats only 15 per year
 
11:56 AM
yup
 
Ohhhhhh
 
2 .coms
I got them for a VERY sweet deal
half a decade for like 70$
idfk how, but I did
so now I have mistersircode.com and deepworld-remastered.com for my website and my game's website
my portfolio website is estimated to be worth 750$
:3
 
Yea but when I need tech support I talk to (Chat) with some red blooded american in america. Not pakistan or someone with a language barrier or reading from a script
and they're smart
 
@Stuart I was born and raised in this country, and I can sincerely say Americans are pretty stupid
you could get better support internationally
 
enuff to have helped me with htaccess in the past
 
11:59 AM
theres a reason a lot of microsoft's tech support are non-american
 
That alone is pretty impressive
Yea gotcha
 
@Stuart Well yes, I wont deny that you could get support
 
01:00 - 12:0012:00 - 22:00

« first day (3839 days earlier)      last day (1092 days later) »