@Tiffany In that case, don't worry about it. Having code you hate is just par for the course. I'm sure that by this point in the afternoon I'd hate the code I wrote this morning if I hadn't been doing reviews and design all day.
@Dereleased This is how I feel about some of my really old CSS and HTML.
I'm reading a third-party vendor's code, send_mail, which receives three parameters, $to, $content, $headers. If the email has an attachment or must be send as HTML, they are keys in the $headers array. I can't help be think there's a better way of doing this. Like having an $options array.
i meant, if you add another character to the gist link, it won't visually monopolize the chat, as it would appear as a link rather than a whole listing :B
There's this youtuber that my friends watch, and he posts some of the most ridiculous videos. There was one where he poses as a pick-up artist and says he has all of the answers, waits until the end of the video to tell them, and says the answer is to be overweight or something, "gotta have dem guts, dem walls" or something
Write meaningful code, don't worry about performance (as they cheer "hypocrite" at me), write code that is verbose and makes it obvious what the intention is
When you say rely on the compiler because it does a lot for you, I think of the optimizations done by something that permanently compiles vs a scripting language. Since the scripting language must compile on every run, it will never (probably) have the time to do really heavy optimization
@NikiC see above message, I think it's a really bad idea to maintain a separate list of ciphers - obviously we can't rely on systems to have an up-to-date installation of openssl, but we shouldn't maintain it ourselves. Any opinion?
@LeviMorrison Absolutely, and it'd be dope if there were a scraight up optimizing compiler that would cache results for use in prod, but still do regular interpretation otherwise
@Dereleased for the average use-case (php as a web scripting language, loaded as a module in a web server or as fpm), the opcode cache is loaded by default - it is compiled once per change in file modified times, per stat()
@Leigh If that were one of my cats, there's a 50% chance it would try to fight the screen, 25% chance it would run away, and 25% chance it just goes to sleep right there.
@LeviMorrison I meant to have phpstorm set to convert tabs to spaces. So I could use tab, and it would space four times. Never got around to fixing it.
@LeviMorrison until someone comes in from Perl and, not being used to have barewords for true and false, passes 1. It doesn't work, so they start a smear campaign on twitter. By the time you know what's happened, it's too late. Upwards of 3 people on the internet think you did something silly.
@Tiffany and isset will do the job - but key set and value null, isset wil be false but array_key_exists will be true - you need to know what behaviour you want
Seems like @Tiffany only wants a true value if the thing is true anyway, so isset() would be fine. I'm tempted to say it'd be faster, but even if that's true, it's probably missing several points.
(I have this memory of isset() not working properly with undefined offsets. It's probably an old user-error that I overcorrected for in the past, but, well, here we are)
@Dereleased I'm just writing a method for the class, so I can divvy out work to other areas in the classs instead of having it all in the send_mail function :3
I'm going to use this:
public function hasHTML($options)
{
return array_key_exists('html', $options) && $options['html'] === true;
}
RewriteCond %{REQUEST_URI} ^(.*)[A-z]$ [NC] <--- this is affecting internal calls for resources like IMG SRC, the same as external calls to URL's - is there an htaccess equivalent to REQUEST_URI that applies to only URI calls from a remote request and not the server side calls?
we rebuilt a website that used to have like 80 url's indexed by various search engines that had geo tags in them such as: www.website.com/city1-plumbing www.website.com/city2-electrical-help etc. etc. etc. - i don't even know all the bad URL's that are indexed now - so instead of tracking them all down, we just wanted any URL request from a remote IP (browser) that contained more than the base URL to be redirected to a new sub folder containing the revised site
@DMSJax The rule I sent you will allow through requests to things that actually exist (like your images and CSS files). After those three lines, add in your rules for routing to the new directory