Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
fuf
Sep 12, 2004

haha
Thanks for the tips.

The Dave posted:

Do your client and the world a favor by not having a html signature.

Ours is not to reason why

Adbot
ADBOT LOVES YOU

fuf
Sep 12, 2004

haha

Tei posted:

data-url allow to embed images in the html, so html signature could have a image withouth using a attachement or a remote file

some newsletters services even do that themselves, automatically embedding images this way for the images near the top of the email


Moto42 posted:

You beat me to it.
http://dataurl.net/ will get you running with them.

I've been trying this today and I'm not sure why it's better than hosting the images remotely? They might show up more reliably but aren't you clogging up everyone's mailboxes with data? For a newsletter I get it but for the signature of someone who's emailing back and forth all day it seems like a bad idea... Converting the logo they wanna use to data-url gives me a ~50kb .htm file. It's not much but would add up pretty quickly if everyone in the company uses it.

If email signatures are an affront to internet civility then isn't at least hosting the images remotely a little better?

fuf
Sep 12, 2004

haha
But isn't 50kb of bandwidth when you open the email better than 50kb of storage space in your mailbox per email? The email client could cache the image once, or download it each time, but either way seems better than 50kb + 50kb + 50kb for every email passing back and forth. Maybe I just don't get how email clients deal with remote images.

fuf
Sep 12, 2004

haha
It's a 4kb logo png and then like a 35kb jpg banner promoting their new thing. I'm not trying to be difficult just trying to learn.

fuf
Sep 12, 2004

haha
Is there a site like mailchimp but just for plain text emails? I need to send an email to about 500 people every two months or so.

fuf
Sep 12, 2004

haha

LifeLynx posted:

I agree that emails are black magic though, I get at least three emails a month that are along the lines of "Client's contact form submissions keep going to their Outlook/Gmail's spam folder, can you figure out why?"

Something like https://mandrill.com/ is helpful for this. A trustworthy middleman between your hosting (which could be on all kinds of spam blacklists) and your client's inbox. There are plugins (lol) that will change WordPress to route all email through Mandrill or Mailgun or a similar service.

Seconding Ninja forms as a good forms plugin.

One of the big benefits of using WordPress to learn web development is that it's so popular that every conceivable problem or question you have has been answered a million times. Some of the answers will be bad but there's no shortage of information.

By contrast I've been trying to learn Umbraco recently and you're really kind of on your own for a lot of stuff. The forums are friendly and the documentation that exists is good but it's just a lot tougher because it's not as popular.

Actually it's been kind of demoralising and I'm thinking of going back to WordPress and focusing on PHP, even though it's a lot less "cool". I'm trying to make the jump from jack-of-all-trades freelancer to finding an actual position as a dev somewhere, and it's really hard to know what to focus on.

fuf
Sep 12, 2004

haha
I'm doing a dev challenge test thing and the task is "increase the size of the font throughout the entire page to 125% of its current size when viewing the page in a window smaller than 500px wide."

Is this enough or am I missing something?

code:
@media(max-width: 500px){
  body{
    font-size:125%;
  }
 }
It works but seems too easy.

All the font sizes in the css use em like:
code:
p{
font-size: 1.5em;
}
There's no default base font size set on body (maybe I should set one?)

fuf
Sep 12, 2004

haha
Cool, thanks. That's reassuring. It's just weird because it came after a list of other challenges that were way harder.

fuf
Sep 12, 2004

haha
Can anyone help me with a bit of reliable Apache code I can plop in .htaccess for every site I host that will:
1) redirect any http url to https
2) redirect any www url to non-www
including any combinations of the two.

This is what I've cobbled together from googling but it bugs me that the www redirect uses the actual site url (so I can't just reuse exactly the same snippet on each site) and I'm not sure whether there's a risk that the two rules might conflict with each other somehow.

Does the order matter?

code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^[url]www.mydomain.net[/url] [NC]
RewriteRule ^(.*)$ [url]https://mydomain.net/[/url]$1 [L,R=301]

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) [url]https://%[/url]{HTTP_HOST}%{REQUEST_URI}

fuf
Sep 12, 2004

haha
If an image's EXIF data contains "OrientationRotate 180" then chrome (and others?) will show it upside down by default. Is there an easy way to stop this?

There's a CSS rule called image-orientation but it's deprecated and doesn't seem to work anyway.

Is it usually possible on the web server to just strip exif data before serving the image?

The images are coming from an external system so might not be possible to remove the data directly from the image file...

fuf
Sep 12, 2004

haha
thanks brother

I casually mentioned that EXIF data also contains location, timestamps, camera model etc. and now this has spiralled into a panicked conversation about data privacy that is way above my pay grade hehe

fuf
Sep 12, 2004

haha

Bruegels Fuckbooks posted:

b) The exif orientation is supposed to be correct (set by device). If the images are appearing the opposite orientation, what could be happening is that you guys have code that is trying to apply the exif orientation in js or something, but since browser recently started respecting the tag, the orientation is getting applied twice.

Most of the images are fine, it's only a few that have this orientation tag in their EXIF data that contains either 90, 180 or 270 degrees (and Chrome is displaying them, "correctly", with that rotation). The images have been uploaded by users and come from ipads etc. so maybe they were rotating the device in a funky way when taking the picture...

Bruegels Fuckbooks posted:

c) The css style "image-orientation: none" should turn off the exif orientation in chrome, but ONLY if the element is attached to the DOM. e.g. if you are just loading into image element and drawing to canvas without attaching element to dom, the style won't do anything.

uhh sorry but what do you mean by attached to the DOM? The images are displayed like:
code:
<img src="https://externalsystem.com/image.jpg">
(and image-orientation doesn't work)

fuf fucked around with this message at 14:58 on Mar 29, 2021

fuf
Sep 12, 2004

haha
Did Google change their algorithm to care more about page speed recently or something?

I have a few hosting clients suddenly obsessed with their Google PageSpeed Insights score that never used to care.

It's annoying because I tell them that their site is objectively very fast but they only care about this one number that Google is giving them, along with Google's weird suggestions.

fuf
Sep 12, 2004

haha

go play outside Skyler posted:

If they pay by the hour

I think this is really the key to making these situations bearable. It still hurts but it hurts a lot less if you know you can bill for the extra hours.

fuf
Sep 12, 2004

haha
can anyone help me parse this sentence and figure out what they are asking for?

quote:

we need a one-hop type core redirect from all -non-www/http and https- to go to https://www.domain.com and the root URL made indexable. The https://www.domain.com/index.html page to remain non-indexable but the canonical tag pointing to the root homepage URL https://www.domain.com/

Redirect http://domain.com and https://domain.com to https://www.domain.com - ok that's fine, I can put a 301 redirect in the .htaccess file

Make the root URL indexable - ???

domain.com/index.html to remain non-indexable - ???

Add a canonical tag to domain.com/index.html pointing to domain.com - ok I guess but seems pointless??

They seem to think that domain.com and domain.com/index.html are totally separate pages. I know the URLs are technically different but does that really affect SEO?

I dunno if there is an SEO thread but maybe this would be better there

fuf
Sep 12, 2004

haha
what's it called when you can do like div.hello then press tab to generate
code:
<div class="hello"></div>
?

And how do I get it working in visual studio? Visual studio will generate div tags if you just write div and then tab, but it doesn't do classes and IDs with div.class and div#id

e: it's called zen coding and there's an extension :)

fuf fucked around with this message at 15:28 on Oct 29, 2021

fuf
Sep 12, 2004

haha

barkbell posted:

its the emmet plugin

oh cool, thank you, this is even better

fuf
Sep 12, 2004

haha
I have a div with a <video> element in, and the div can change size quite a lot, especially switching from a landscape to a portrait aspect ratio. I don't mind cropping the video a bit to avoid horizontal or vertical black bars, but I want there to be a limit beyond which it will prefer black bars over cropping the video any further.

Any suggestions on how to accomplish this? I can crop the video by setting its width or height to >100%, but I can't figure out how to set like a "max crop".

fuf
Sep 12, 2004

haha
Thanks. I think the main issue is that I'm using things like width / height percentage and transform:scale to crop the video, but of course the same values will crop the video differently depending on the size / aspect ratio of the containing div. I need like an objective way to set the crop limits on the video itself. Basically I'm imagining like a rectangle drawn on to the video that says "crop the video up to the limits of this rectangle but no further".

fuf
Sep 12, 2004

haha

I've been playing with object-fit:cover and it does the cropping but I still can't figure out how to limit the crop past a certain point.

fuf
Sep 12, 2004

haha

Ima Computer posted:

There's no way to do this with pure CSS... at least not until container queries are a thing.

Use a ResizeObserver to detect when the container <div> changes dimensions. Calculate the aspect ratio of the div, and then toggle a class on the <video> that swaps between object-fit: cover and object-fit: contain based on whether or not the aspect ratio is within a certain range (plus or minus some % of the video's original aspect ratio).

This absolutely fried my brain but I think I've got something kind of working.

I work out the difference between the aspect ratio of the container and the video to figure out if there are horizontal or vertical black bars. Then I work out if I can crop the video to fill that free space without exceeding the maximum vertical or horizontal crop limits I've placed on the video. Then I use transform: scale to zoom the video to the max allowed. It sounds simple when I write it down but woooo boy.

fuf
Sep 12, 2004

haha
Is there any way to "undo" a 301 redirect from site A to site B if I no longer have access to site B?

All the stuff I've read involves setting up a reverse redirect from site B to site A, but I can't do that...

If the redirect is gone from the .htaccess of site A, will the internet eventually catch on and stop redirecting people? Is it just an individual browser cache issue or does the redirect actually get stored by DNS servers etc?

e: right now I can't even get the redirect to stop firing on my local machine, even though I swear there's nothing cached locally

fuf fucked around with this message at 15:49 on Jan 21, 2022

fuf
Sep 12, 2004

haha

kedo posted:

In theory if you remove the redirect on site A, the page will eventually get indexed again and it'll start showing up in search results. It'll just take longer than if you were to create a new redirect on site B.

If it's an .htaccess redirect it shouldn't be getting cached anywhere, changing it should be instantaneous unless I'm terribly mistaken. Is it defined anywhere else?

hmm the redirect was setup in cPanel so I'm not sure if it was done with .htaccess or something else.

the main domain for the cPanel account was domain A, and domain B was a domain alias with a permanent redirect to domain A. I've removed it as an alias and added it as an addon domain instead, but it's still redirecting to domain A.

fuf
Sep 12, 2004

haha

Pablo Bluth posted:

If a web page (not mine) is using a <video> element, is there a way stats about the video it's playing? I want to check the resolution/framerate/bitrate of the video file?

This is an old post but I had to do the same thing recently and I don't think a <video> element really knows anything about the video it is playing.

You have to download the complete video file and then scan it on the server to get the metadata. I did this in .NET using Puppeteer-Sharp to do the scraping of the video file, then FFMpegCore to generate the metadata. Let me know if you want any more detail.

fuf
Sep 12, 2004

haha
the ubiquity of two factor authentication has made my life so much harder sometimes

me: hey [client], can you send me the login code you just got sent? I need to change something on your domain

client: *literally 6 hours later* XC4J5 :)



I have to carefully coordinate times when I can login

fuf
Sep 12, 2004

haha
One of my clients forwarded a spam email they got warning that their site is vulnerable to "clickjacking" and that they need to add an "iframe destroyer" to the site header. How much is this an actual thing? Do I need to do it?

Adbot
ADBOT LOVES YOU

fuf
Sep 12, 2004

haha
spam email was maybe too strong but you know, one of those "dear sir we have found vulnerabilities on your website" emails.

Jabor posted:

if there are any privileged actions on your site that would be bad if they were triggered by an unauthenticated attacker

There's a link to the login page of one of their internal systems, so I guess it would be bad if that link got ~clickjacked~, but seems very unlikely.

But yeah I guess I'll just add
code:
X-Frame-Options: deny
?

Is it gonna break any legitimate uses? This is a standard WordPress site.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply