|
Biowarfare posted:check error.log, probably has nothing to do with file itself Place your bets now! My money is on an .htaccess mistake.
|
# ? Aug 9, 2015 12:49 |
|
|
# ? May 8, 2024 09:50 |
|
v1nce posted:Place your bets now! My money is on an .htaccess mistake. Apache 2.4 breaks people that don't know how to use grant/deny, it's really funny too But yeah probably htaccess typo or something
|
# ? Aug 9, 2015 13:41 |
|
v1nce posted:Place your bets now! My money is on an .htaccess mistake. I'm going long shot money on parent directory set to 600 permissions.
|
# ? Aug 9, 2015 14:53 |
|
Lumpy posted:Maybe your first result is cached: both are 500 errors for me. What do the Apache logs tell you? I'm dumb, you're right. Biowarfare posted:check error.log, probably has nothing to do with file itself [Sun Aug 09 11:55:33.736210 2015] [core:alert] [pid 16500] [client] /var/www/laravel/public/test3/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration, referer: I guess I totally brain farted and didn't think 500 errors would show any more info in apache logs, I guess I learned something today! First google result for this error showed I didn't have the Header module enabled. Thanks folks.
|
# ? Aug 9, 2015 17:12 |
|
Lumpy posted:I'm going long shot money on parent directory set to 600 permissions. this should generally just show a 403 I would think
|
# ? Aug 9, 2015 22:08 |
hayden. posted:I guess I totally brain farted and didn't think 500 errors would show any more info in apache logs, I guess I learned something today! First google result for this error showed I didn't have the Header module enabled. Thanks folks. Yup. Whether it's an Apache thing or a bug in your back-end web code (Django/Rails/PHP/whatever), a 500 error will always mean "poo poo's breaking on the server and you'll find out exactly what in a relevant log file".
|
|
# ? Aug 10, 2015 03:03 |
|
Anyone know any solid tutorials for people not that great with PHP, but needs to make a contact form? I know I could use a template, but I'd rather learn myself.
|
# ? Aug 11, 2015 00:59 |
|
I would suggest Googling and finding one that fits your comfort level, it's going to be hard to know what level tutorial would work best for you. There are a lot of options, just look for a tutorial for forms in general with PHP. Sorry if this isn't super helpful.
|
# ? Aug 11, 2015 03:50 |
|
Grump posted:Anyone know any solid tutorials for people not that great with PHP, but needs to make a contact form? I know I could use a template, but I'd rather learn myself. Are you on any framework like Wordpress or Laravel or are you writing classic PHP? What do you want the form to do? If we know the parameters then we can point you at a reasonable tutorial, and fill in any blanks you don't understand.
|
# ? Aug 11, 2015 04:10 |
|
Grump posted:Anyone know any solid tutorials for people not that great with PHP, but needs to make a contact form? I know I could use a template, but I'd rather learn myself. I had to do a registration system recently with no foreknowledge of PHP and I found the following useful. It has stuff on resetting passwords and activation emails so I am sure there is stuff there you can use http://www.freezecoders.com/2012/11/confirmation-mail-for-user-registration-using-php.html https://daveismyname.com/login-and-registration-system-with-php-bp I also used something called PHP-Mailer instead of the way those tutorials sent emails. It's just some files you download and include in your folder and then you get some handy prebaked email functions.
|
# ? Aug 11, 2015 13:03 |
|
Writing PHP mailers by hand isn't very difficult even if you aren't a PHP pro, but it's not a good idea to use one in practice unless the messages themselves don't matter all that much. Email is black magic and there are so many little tricks that you need to be aware of (depending on your web server and mail server and potentially your user's mail server) in order to have emails end up in the right inbox that it's not worth the effort. If you want to code one as a learning exercise, that's grand. But ultimately you should use something like Gravity Forms if you're on WP, or some stand alone service like Formstack or what have you if you're not. At least then if the messages stop appearing in someone's inbox they're saved in a database somewhere and you're not left holding your dick, saying "well I don't know where they've gone, the form worked for me when I tested it!"
|
# ? Aug 11, 2015 16:20 |
|
I'm hard-coding a personal site because I'm trying to get comfortable with back-end stuff and possibly learn more front-end stuff. I just want to learn some practical stuff.
|
# ? Aug 11, 2015 18:08 |
|
Not to dissuade, but practicality is also knowing when to defer hard problems to better equipped services and transactional email is definitely one of those hard problems with very poor feedback loops. Most professionals who value their time would use Mandrill or something like it to send mail, rather than a local SMTP server which adds yet another thing to administer, debug, and fix if blacklisting occurs. Maybe do both ways if you'd like to learn.
|
# ? Aug 11, 2015 20:18 |
|
Mandrill kicks rear end. I really like how you can log into the web interface and view a history of emails sent. Really helps with diagnostics.
|
# ? Aug 11, 2015 21:13 |
|
Maluco Marinero posted:Most professionals who value their time would use Mandrill or something like it to send mail, rather than a local SMTP server which adds yet another thing to administer, debug, and fix if blacklisting occurs. If you still must code it by hand, do this. PHP mailers are crappy pieces of poo poo code and are not worth your effort to learn. Web servers are dumb when it comes to sending email, and email servers are the neanderthals of the internet. At least Mandrill takes care of all the nonsense work and allows you to focus on creating a useful form. Here's a real world experience re: why you shouldn't make a PHP mailer: 10 years ago: Client: kedo! We need a form on our website so people can send us email. kedo: Okay, presto, here's a form that uses a PHP mailer. Enjoy! 9 years ago: Client: kedo, gently caress! The form isn't sending email anymore, what the gently caress is going on!? kedo: Hmmm. [spends five hours trying to figure out what the problem is] I have no idea, but now it's working again... Idiot host: lol our mail server was down. 7 years ago: Client: kedo, omg! Again with the form not working! Do you even know how to code things?! kedo: Christ... [spends five hours trying to figure out what the problem is] oh, looks like your host updated their mail server and it now requires that emails be authenticated. Idiot host: lol srry shoulda been reading our super-hidden admin blog where we talk about this poo poo, scrub 4 years ago: Client: kedo for the love of god! The form is down again. We are losing business because of you. Make it work now! kedo: loving hell. [spends five hours trying to figure out what the problem is] I have no idea. Did you change anything with your mail settings? Client: Yes, now we're using Google apps! Are you saying you can't keep up with Google?! kedo: Give me your admin credentials. [looks in the hidden spam queue no client can ever find] Look, your messages are all getting blacklisted. Let me ask your host. Idiot host: no we don't want to do work kedo: What the gently caress is going on? You're blacklisted by spamhaus. Idiot host: well sum ppl like sending emails, okay a lot of emails, but they pay us good kedo: Client, you need a new host. Honestly we could use this new service called Mandrill... Client: That costs money! NO. 3 years ago: Client: kedoooooooooo!!!!!!! Idiot host: lol updated mail server again kedo: Except less suicide and more me no longer working with the client. But you know, use a PHP mailer if you want.
|
# ? Aug 11, 2015 21:58 |
|
^^ Why I fired all my clients and stopped doing freelance work altogether.
|
# ? Aug 11, 2015 23:13 |
That story sounds more like "why to do it yourself". (And run automated tests)
|
|
# ? Aug 12, 2015 00:12 |
|
Word. I'll check out Mandrill
|
# ? Aug 12, 2015 02:52 |
|
Does anyone know why this ng-repeat seems to be applying some kind of minute gap between elements generated by the ng-repeat and elements declared before or after it? This markup: code:
Here's the LESS for this particular bit of layout code:
|
# ? Aug 13, 2015 01:27 |
|
Karthe posted:Does anyone know why this ng-repeat seems to be applying some kind of minute gap between elements generated by the ng-repeat and elements declared before or after it? It's picking up the whitespace in the generated HTML, since inline-block makes elements flow like an inline element, which includes being affected by font rules. You should be able to fix it by putting: CSS code:
|
# ? Aug 13, 2015 01:48 |
|
I'm on mobile so I can't properly test but I'm very certain that it's just white-space collapsing to a single space in between the check button and the ng-repeat, and it works like this because they're inline-blocks (so around them standard textual rules apply) You need to do one of: - render the HTML with absolutely no whitespace between the button elements - set the container to font-size: 0 and then reset it in shift-button - use float left on shift buttons to make them position without regard for spacing
|
# ? Aug 13, 2015 01:49 |
|
Depressing Box posted:It's picking up the whitespace in the generated HTML, since inline-block makes elements flow like an inline element, which includes being affected by font rules.
|
# ? Aug 13, 2015 01:54 |
|
Since Browsersync isn't meant to work with a live site (https://github.com/BrowserSync/browser-sync/issues/163), are there any tools that offer similar functionality (mirroring user action through multiple browsers simultaneously) that do?
|
# ? Aug 13, 2015 16:25 |
|
I don't know if this is the right thread to ask in, but it's worth a shot. I've got a Flask app I'm trying to run on AWS (the server is running Apache on Ubuntu), and it needs a data file. The file is located in the root directory of the app. On the local Flask development server, things are fine, but after getting most of the difficulties deploying worked out, I'm now staring at a problem that doesn't make sense. The file location is hard-coded into the app, so it appears in the Python file as code:
What am I doing wrong? EDIT: it was a weird permissions problem. Ghost of Reagan Past fucked around with this message at 06:52 on Aug 17, 2015 |
# ? Aug 15, 2015 20:57 |
|
Hey, not sure if this is a simple HTML/CSS problem or not, but I'll ask it anyway. Is there any way to make a webpage start in the middle of the page, such that you can click an arrow at the top to scroll to content that's hidden above, and a bottom arrow to content that's hidden below? What I'm thinking of is using something like fullPage.js (http://alvarotrigo.com/fullPage/) except with the site starting on the second section instead of the first one.
|
# ? Aug 18, 2015 19:37 |
|
Suicide Watch posted:Hey, not sure if this is a simple HTML/CSS problem or not, but I'll ask it anyway. Is there any way to make a webpage start in the middle of the page, such that you can click an arrow at the top to scroll to content that's hidden above, and a bottom arrow to content that's hidden below? Yes, the easiest way is to use an anchor but unless you have something super specific why would you that? Unless there's a massive UI revolution in the next two weeks the top of your page is where all of your visitors are expecting to start.
|
# ? Aug 18, 2015 19:42 |
|
Do HTML5 video backgrounds not work on mobile devices? I could swear they used to but I set up a video tag with a webm and mp4 video and it does not show on Android chrome nor on an iPad but works perfectly fine on desktop browsers.
|
# ? Aug 19, 2015 00:18 |
|
How do I get started with testing? I'm a one-man army out of necessity and so I need to learn how to write tests for both Django/Rest Framework and Angular. The testing libraries and whatnot are already in place - I just need to start writing the actual tests. But every time I think about starting I get overwhelmed because it feels as though it'll take me forever to write multiple tests for every single function I've written thus far. So how do I get started? Do I start with basic functions first, then move on to more complex ones? Are there things that don't need testing? How complex should a test be? I've never done this stuff before and I'd appreciate a point in the right direction.
|
# ? Aug 19, 2015 00:41 |
|
Suicide Watch posted:Hey, not sure if this is a simple HTML/CSS problem or not, but I'll ask it anyway. Is there any way to make a webpage start in the middle of the page, such that you can click an arrow at the top to scroll to content that's hidden above, and a bottom arrow to content that's hidden below? This is a stupid idea.
|
# ? Aug 19, 2015 01:21 |
|
nexus6 posted:Do HTML5 video backgrounds not work on mobile devices? I could swear they used to but I set up a video tag with a webm and mp4 video and it does not show on Android chrome nor on an iPad but works perfectly fine on desktop browsers. Didn't in a recent project so we just did a feature test and fell back to images (which you should have prior to lading anyway). I didn't implement so I don't know what test. To be honest it's probably better we don't have auto playing video on mobile, we can't be trusted to use it responsibly. :p
|
# ? Aug 19, 2015 03:37 |
Karthe posted:How do I get started with testing? I'm a one-man army out of necessity and so I need to learn how to write tests for both Django/Rest Framework and Angular. The testing libraries and whatnot are already in place - I just need to start writing the actual tests. But every time I think about starting I get overwhelmed because it feels as though it'll take me forever to write multiple tests for every single function I've written thus far. The best way to get yourself into the groove of it (I think) is to write tests that you know will be immediately helpful to you. Like, you know that one finicky function or layout that you're genuinely worried about it breaking if you gently caress with something? Write a test for it and set up the hooks to run it automatically. Then let it do its job, which is to take a load off your mind while you develop and to tell you when you broke something. Then think of the next most important thing you need to keep tabs on, and write a test for that, only now you don't have to set up any automated testing hooks because you already did that. And so on and so on. At some point you'll find yourself with several small libraries of tests covering a variety of functional areas, all of them performing a valuable function for you because you know why you wrote them. At that point you get to start writing proactive unit tests that cover functional areas you haven't even coded for yet, and then you can decide how deep and broad you want to go in fleshing them out formally.
|
|
# ? Aug 19, 2015 04:09 |
|
Karthe posted:The testing libraries and whatnot are already in place - I just need to start writing the actual tests. So how do I get started? Data Graham posted:Test stuff that scares you You can easily identify the parts you absolutely want to be testing because when you run them and say "well, that seems to be working". Usually this kind of code gives me an itch in the back of my mind anyway, and unit tests are a great way to stop you worrying. Besides complex or ropey code, you should also definitely write tests for any reusable code. This means you know these parts are reliable and you can safely build on their foundations. In the course of testing reusable code you'll often figure out a new way you want to use that code, discover it doesn't handle that case, and then you can create a failing test which you can fix. Welcome to TDD. For example, we had a pagination class which we expanded to handle the various sort options of "Asc", "asc", "ASC", and SORT_ASC. It used to only handle the last two, before we made the unit tests. Karthe posted:Do I start with basic functions first, then move on to more complex ones? For your own sanity, start with the most basic stuff and move on from there. Sometimes the easiest code to test isn't actually the simplest, but rather the one that accepts and returns the most basic data types and structures. It can be a royal pain in the rear end to mock up a ton of fixtures just to test something like a recursive delete function, but testing a static filter which accepts a User and returns a bool is super easy. What you don't need to test really depends on the framework and the language. Seeing as you're just starting, it's unlikely you'll get to a point where you're wondering "do I need to test that?" because there's going to be complex stuff all over the shop you want to build tests for, and there aren't enough hours in the day. That said, one of the usual "why would I test that?" items is getters/setters on objects, for which I usually don't bother in application code. The exception to that rule is if it's reusable code - because so much will rely on it - or if the getter/setter manipulates data, or handles various types. As for complexity, unit tests should be as basic as possible. You're trying to test a unit of code, which may just be part of a function. This is why you build code which has minimal dependencies and single responsibilities - so you can take a tiny tiny chunk of it, and verify it does the one thing it's supposed to do.
|
# ? Aug 19, 2015 05:09 |
|
v1nce posted:What you don't need to test really depends on the framework and the language. Seeing as you're just starting, it's unlikely you'll get to a point where you're wondering "do I need to test that?" because there's going to be complex stuff all over the shop you want to build tests for, and there aren't enough hours in the day. I like to start with a coverage report and look at the complexity/major gaps. So basically any function or method with lots of logic, which could also lead to being broken down later anyway. For JavaScript I recently found Plato for generating coverage reports. It isn't as good as Junit or phpunit in my opinion, but worked well enough to identify what code to write tests for first.
|
# ? Aug 19, 2015 11:48 |
|
My Wordpress permalinks are giving a 404 in nginx if I use the standard:code:
code:
I don't understand the difference between the index.php?$args in try_files and the one in error_page - why would one work and not the other? The only difference is that try_files is in the "location /" block: code:
Any ideas?
|
# ? Aug 20, 2015 21:11 |
|
No Nginx expert, but I imagine it's because when try_files exhausts itself it triggers it's standard 404 behaviour. The problem is it calls index.php?$args and receives a 404, so then it goes right, didn't find anything so I'm gonna show my 404 page, which unless you override it is going to be the default. All that said, Wordpress is better set up on Apache because it automatically sets up its own htaccess, which is likely a horror but IS the way it rolls. If you insist on setting up with nginx, read this, https://codex.wordpress.org/Nginx, because try_files is not the way you should be executing php, it should be going through php-fpm.
|
# ? Aug 20, 2015 22:40 |
|
fuf posted:Wordpress and nginx Try something like this out https://github.com/Varying-Vagrant-Vagrants/VVV/blob/develop/config/nginx-config/nginx-wp-common.conf
|
# ? Aug 21, 2015 03:27 |
|
Maluco Marinero posted:No Nginx expert, but I imagine it's because when try_files exhausts itself it triggers it's standard 404 behaviour. The problem is it calls index.php?$args and receives a 404, so then it goes right, didn't find anything so I'm gonna show my 404 page, which unless you override it is going to be the default. All that said, Wordpress is better set up on Apache because it automatically sets up its own htaccess, which is likely a horror but IS the way it rolls. That try_files line actually comes from the nginx Codex page. I think it's meant to work like this: it looks for the file directly, then it looks for a directory, then it falls back to the WP index.php (which goes through php-fpm) and passes the url so WP can figure out what page to show. I figured out that it was this restriction rule that was causing the problem: code:
|
# ? Aug 21, 2015 11:20 |
|
Maybe it's parsing the . as "current directory" rather than "files that begin with ."
|
# ? Aug 21, 2015 13:07 |
|
Ruby question: I'm looking for a service that can connect to private github repos and automatically build gems therein and be a gem source for said gems. Ideally this would be something I can pay for rather than host myself. I've looked around to no avail. I guess github used to do something like this for free but it was discontinued several years ago. Gemfury has this concept but will be a git remote themselves rather than connecting to github. I'm very surprised this isn't a thing. Anyone know of anything like this?
|
# ? Aug 21, 2015 14:15 |
|
|
# ? May 8, 2024 09:50 |
|
I'd like to get some opinions on something - let's say you were tasked with creating a website builder like SquareSpace, Wix, Weebly, etc. Performance and scalability are paramount. Which DBMS and back-end language would you choose? Would you use a front-end framework?
|
# ? Aug 21, 2015 15:14 |