|
I have a site I put together today for people to share game save files. Here's an example file: http://besiegedownloads.com/uploads/54d8027ee1979Bomber.bsg Is there an easy way to force this to download when you click it, rather than showing in the browser? It's on a shared hosting account so I am not sure I can use an Apache solution I found (only have "Apache Handlers" option in cPanel). Do I need to point to a PHP page that then has proper headers and then have it read the game save file? Or is there an easier way?
|
# ? Feb 9, 2015 02:51 |
|
|
# ? May 9, 2024 02:29 |
|
I'd imagine if you can upload and execute PHP on the server then you must surely be able to upload a .htaccess file. I know you said you don't think you can do it, but just humor me and try this: Create a file called .htaccess and add the following: code:
If you can't make a file called .htaccess because windows complains, call it "htaccess" without the dot, and rename it after you upload it. If that doesn't work, try changing the content of the file to some garbage (random characters) and upload that. If you don't get a 500 server error, then you can't use a .htaccess solution because it's disabled on the server.
|
# ? Feb 9, 2015 03:02 |
|
Placed the htaccess in both root and upload directory with no luck (still there, you can test for yourself). I saw someone else say they tried that on stackoverflow without success so I skipped that step. Random garbage did in fact lead to a 500 error. Thanks a ton for the help, let me know if you can think of something else to try edit: this is sweet, adding "download" to your anchor tag forces this. That helps for on-site links, but would still be very helpful for links on other sites to download correctly too. edit2: Seems to work now, I changed it to "ForceType" then back to what it was, and suddenly it's working. Not sure why. Of course IE still doesn't save properly. hayden. fucked around with this message at 03:29 on Feb 9, 2015 |
# ? Feb 9, 2015 03:08 |
|
Set the Content-Disposition in Apache (here's a guide or just google it)
|
# ? Feb 9, 2015 03:31 |
|
IE is kind of a jerk and has several methods to try and detect the type of file and act in the way it thinks you want to interact with it. You can turn that off by forcing it to recognise the file as an attachment, using something like this: code:
If you want a PHP solution, give this article a read: http://www.media-division.com/the-right-way-to-handle-file-downloads-in-php/
|
# ? Feb 9, 2015 03:36 |
|
Lumpy posted:a) a script grabs the price of silver, either from an API, or scraping it off another site. My knowledge is limited to the basics of html/css at this point - do you have any recommendations for where to start learning about how to put a page like that together?
|
# ? Feb 9, 2015 04:52 |
|
Do you guys have any recommendations on places to read to keep abreast of general web dev and design news? I currently look at echojs and anything that pops up on twitter, but that's about it.
|
# ? Feb 9, 2015 07:56 |
|
neurotech posted:Do you guys have any recommendations on places to read to keep abreast of general web dev and design news? I currently look at echojs and anything that pops up on twitter, but that's about it. http://sidebar.io Ron Don Volante posted:My knowledge is limited to the basics of html/css at this point - do you have any recommendations for where to start learning about how to put a page like that together? Sure thing. I'll throw something together this am if nobody beats me to it.
|
# ? Feb 9, 2015 12:10 |
|
neurotech posted:Do you guys have any recommendations on places to read to keep abreast of general web dev and design news? I currently look at echojs and anything that pops up on twitter, but that's about it. I enjoy The Shoptalk Show podcast. They discuss current news/drama, and are also quite entertaining.
|
# ? Feb 9, 2015 17:55 |
|
neurotech posted:Do you guys have any recommendations on places to read to keep abreast of general web dev and design news? I currently look at echojs and anything that pops up on twitter, but that's about it. http://webplatformdaily.org/
|
# ? Feb 9, 2015 18:32 |
|
IE10 is supposed to raise the selector limit from the 4095 IE9 and below were limited to, right? I have one specific style that doesn't show up at all unless I force the site to load the blesscss'd css file for IE9 and below. Of course, the real issue is that there are way too many selectors but I'm just curious about this.
|
# ? Feb 9, 2015 19:05 |
|
Is there any way to get the visibility classes for Foundation (hide-for-small-only, show-for-small-up, etc) to display inline when visible? It seems it's either block or none which is not what I want. If I do inline!important then it just never hides.
|
# ? Feb 9, 2015 21:27 |
|
The Merkinman posted:Is there any way to get the visibility classes for Foundation (hide-for-small-only, show-for-small-up, etc) to display inline when visible? It seems it's either block or none which is not what I want. If I do inline!important then it just never hides. Media queries sound like the solution you need. CSS code:
|
# ? Feb 9, 2015 21:35 |
|
I've got a solution to a problem but it's basically hacking around a bush with a machete and I was wondering if there's a really easy and elegant solution I'm completely overlooking. I've got a php function php:<? function Images($mode,$article,$youtube = NULL) { $thumbsGlob = glob("images/$mode/$article/$article*g.jpg"); natsort($thumbsGlob); if($youtube) { array_unshift($thumbsGlob,$youtube); } return $thumbsGlob; }?> Is there a nice succinct way to tell php to use the base directory for pathing regardless of what directory the function is called in while also providing a URL to the resource that doesn't require cleaning up before sending back for use?
|
# ? Feb 9, 2015 22:10 |
|
TheEffect posted:Copying and pasting the image URL gives me the following default 404 from ApacheTomcat- I went ahead and set the site up on my public dev server- https://www.galaxyforge.net/dev/html/ROOT/html/Old_Ops_Website . As you can see here- https://www.galaxyforge.net/dev/html/ROOT/html/Old_Ops_Website/pics the photos are in the correct directory, the HTML page is referencing the correct images, but nothing is coming up. FYI - I didn't create this site. This is about 10-15 years old which is why I'm hiding it on our current site as an easter egg for people to get a laugh at.
|
# ? Feb 9, 2015 22:58 |
|
I don't want you to kick yourself, but looking at your pictures folder the images you mentioned as working work because they are .jpg The images that are not working do not work because they are linked as .jpg on the index but are, in fact, .JPG
|
# ? Feb 9, 2015 23:22 |
|
Ghostlight posted:I don't want you to kick yourself, but looking at your pictures folder the images you mentioned as working work because they are .jpg Wow. I didn't even consider that to be an issue since they showed up on the host machine just fine. You're absolutely right, that was indeed the issue. Now I can stop ripping my hair out. Thank you so much!!!!
|
# ? Feb 9, 2015 23:36 |
|
Stupid question incoming! I need advice on a htaccess file. I would like the root to redirect to either yes.html or no.html depending on which ever one exists. Is this possible? I have a stupid site where I want to upload a simple file to display yes or no. To change this I will upload either file and delete the other.
|
# ? Feb 10, 2015 00:02 |
|
thegasman2000 posted:Stupid question incoming! I need advice on a htaccess file. I would like the root to redirect to either yes.html or no.html depending on which ever one exists. Is this possible? Why don't you just call it index.html and rename/edit the file when YES happens?
|
# ? Feb 10, 2015 00:03 |
|
Edit: Dont worry I found out the $2.99 app I got allows editing. Changing 3 letters was MUCH easier! thegasman2000 fucked around with this message at 00:08 on Feb 10, 2015 |
# ? Feb 10, 2015 00:04 |
|
Cross-posting from the Front-end Developers thread, can anyone give me some advice on how I might improve my Firebase Auth service to better convey error messages to AuthController? The tutorial I was working through uses an older version of the AngularFire so I had to update the code to work with the new authentication API calls. I'm having an issue where errors are caught in the Service, so the Controller has no idea that anything's gone wrong unless I check for an error every time the function is called. Here's the start of my Auth service: code:
code:
code:
|
# ? Feb 10, 2015 00:36 |
|
Karthe posted:Right now everything works fine but I'm getting the feeling that there's a better way to do this. Your use of .catch is deceptive and over complicating this whole thing. .catch(errorCallback) isn't acting like try/catch, but instead it's just for handling a deferred promise object which gets .reject()'d. Auth.register is returning a Defered promise object. During Auth.register you're attaching callbacks to it, and they simply update properties of the Service. This is fine if you want to store the last error, but not necessary if you want to handle the reject() case. Your code works because you can attach multiple handlers to a promise resolve/reject occurrence. I'm actually a little conflicted as to how your code is working anyway, because you only handle the resolve() (.then) outcome of the promise in the controller, and not the reject() (.catch) outcome. I wouldn't expected your code to work properly. You could probably simply with this instead (untested): code:
code:
|
# ? Feb 10, 2015 04:07 |
|
Hey, I wonder if someone can help with a jQuery issue! Here's a simplified Codepen (this is kind of cobbled together from the actual code, so stuff looks weird and doesn't line up, colours have been stripped out etc, images replaced with temp images etc): http://codepen.io/anon/pen/gboLYx The navigation on the left is intended to always be the same height as the image to the right. So as the page size decreases, and the image gets smaller, so do the list items. Or if a new list item is added, the overall list is still the same height. Hovering over a nav item with a submenu makes the submenu appear to the right. This all works fine. Under a certain size - 1024px - the image becomes 100% width, and the nav is hidden, toggled by a menu icon. Clicking this slides down the nav. To reveal a submenu, clicking a "+" icon opens the menu. This is all triggered both on document.ready and on window.resize. The window.resize is working fine for the larger screens, recalculating the height of the list items as the screen is reduced in size. but when you get below the 1024px breakpoint, the hasDropdown submenu should be activated by clicking, rather than by hover. It works fine if you refresh the screen, but actually shrinking down to that size isn't triggering the change - code within the if(window.width > 1024) conditional statement is executing, even under 1024 if you shrink down to get there. If you start under 1024, then expand the window bigger, it seems to work fine. If you could make me understand why the window.resize is ignoring the conditional, I'd be really grateful! I'm quite new to jQuery so this is a learning experience for me. Thank you!
|
# ? Feb 10, 2015 16:35 |
|
Not sure if this is the correct thread, but can anyone tell me the best way to go about obtaining a domain name that, according to who.is, is "reserved by the Registry in accordance with ICANN Policy"? It's a .house domain.
|
# ? Feb 10, 2015 17:18 |
|
caiman posted:Not sure if this is the correct thread, but can anyone tell me the best way to go about obtaining a domain name that, according to who.is, is "reserved by the Registry in accordance with ICANN Policy"? It's a .house domain. You can't, it's not for sale. ICANN has reserved the name for a specific organization. I'm not sure if it's all inclusive, but anything on this list is more or less off limits. You trying to get white.house? You crafty bastard.
|
# ? Feb 10, 2015 17:40 |
|
kedo posted:You can't, it's not for sale. ICANN has reserved the name for a specific organization. I'm not sure if it's all inclusive, but anything on this list is more or less off limits. Nope, trying to get my name, chris.house. I can't figure out why it's reserved
|
# ? Feb 10, 2015 17:59 |
|
Is there any recommended reading on how best to store/structure data in a NoSQL database? I'm pretty comfortable with SQL and relational databases but NoSQL is like the wild west to me. For example, foreign keys don't appear to really be a thing so it seems easy to inadvertently end up with duplicated data all over the place. Edit: v1nce posted:If you still want Auth.error to be present, then there's no problem in keeping that around in the service for other things to access if they're interested (think of it as "lastErrorThatOccurred"). But if you can deal with the promises directly and capture the errors usefully, there's no reason to keep it around. IAmKale fucked around with this message at 18:58 on Feb 10, 2015 |
# ? Feb 10, 2015 18:01 |
|
The whole point (correct me if I'm wrong pls) of a nosql db is that there is no relational data. You're either storing high-performance key/value data or unstructured documents. If you need relations you use something else. As far as I know the only way to get something like foreign keys to work would be in your application database wrapper. Which seems fine to me--keep your rdbms and key it in software to whatever nosql solution you need for that portion of your data. We actually do this at work to coorelate memcached values to data in our Postgres DB.
|
# ? Feb 10, 2015 18:58 |
|
revmoo posted:The whole point (correct me if I'm wrong pls) of a nosql db is that there is no relational data. You're either storing high-performance key/value data or unstructured documents. If you need relations you use something else. As far as I know the only way to get something like foreign keys to work would be in your application database wrapper. Which seems fine to me--keep your rdbms and key it in software to whatever nosql solution you need for that portion of your data. We actually do this at work to coorelate memcached values to data in our Postgres DB.
|
# ? Feb 10, 2015 19:27 |
|
Karthe posted:Foreign keys were just an example of a difference between the two. I'm more interested in reading up on best practices for modeling data in a NoSQL-friendly way. Since NoSQL covers a HUGE gamut of things from document stores (Mongo and pals) to Key-Value Stores (Redis & co.) to graph DBs, there's no "best practice for NoSQL". Duplicated data is sometimes the correct thing to do in document based versions....
|
# ? Feb 10, 2015 20:02 |
|
Anyone know of a JS library that'll give me basic, user-editable diagramming objects. The one on http://rkirsling.github.io/modallogic/ is close enough that I could probably mash it into approximately what I want it to be, but I'm looking for something a little less opinionated about how it looks out of the box and that won't move itself around. It'd only have to support 'boxes' and 'lines' if that makes it easier.
|
# ? Feb 10, 2015 20:19 |
|
Lumpy posted:Since NoSQL covers a HUGE gamut of things from document stores (Mongo and pals) to Key-Value Stores (Redis & co.) to graph DBs, there's no "best practice for NoSQL". Duplicated data is sometimes the correct thing to do in document based versions.... Find the best database for your goal. Here's a good list
|
# ? Feb 10, 2015 20:49 |
|
Chris! posted:If you could make me understand why the window.resize is ignoring the conditional, I'd be really grateful! I'm quite new to jQuery so this is a learning experience for me. If you load the window at a > 1024 size, it will attach the .hover() handler to the .hasDropdown li's. If you then shrink the window down to a < 1024 size, it will go through the conditional again and not attach the .hover() handler again, but since you're not removing it either, it will still be there from the previous time. The .hover() handler is basically a shortcut for checking the 'mouseenter' and 'mouseleave' events, so you'll need to specifically remove those in the else portion of your conditional: code:
You may also want to consider moving the functions in your conditional to seperate functions, have them set a variable to true/false and only use the conditional to check whether the variable is set. Currently, every resize of the window > 1024 has the script setting up the .hover() functions all over, and every resize < 1024 sets up the .click() function all over. Your users will get better performance if the conditional only has to check whether the .hover() and .click() functions have been set, and do nothing if that's the case.
|
# ? Feb 11, 2015 10:49 |
|
Leshy posted:The window.resize is not ignoring the conditional. Hey, thank you for taking a look at this for me! That makes total sense and is a huge help. I've rewritten everything as per your suggestions, it works great on the actual site. I've copied the code into the Codepen, which looks hugely screwed up as most of the css and stuff is missing, but the basic idea still works. Does this look alright to you? I'm inexperienced writing this stuff, so even basic advice (like unbind being superseded by .off) is hugely appreciated. http://codepen.io/anon/pen/VYyyJj Edit: another thing I can't figure out - when I manually increase the size of the window, the height of the left navigation increases to match the height of the image. But if the window size is small, and I hit the Maximize window button (or double click the title bar or whatever), the leftnav doesn't resize at all / it stays small. If I then resize the window manually, it resizes as required. The window.resize event is definitely being recognised, if I put an alert in there it fires as a window.resize event, but it's not resizing the content to match the image height. Any idea what I'm missing here? Chris! fucked around with this message at 13:13 on Feb 11, 2015 |
# ? Feb 11, 2015 12:14 |
|
Anybody have a JS replace() snippet that can translate rgba() functions with opacity into hex with opacity? EDIT: nm figured it out. replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9.]+)\)"/g,'$1="rgb($2)" $1-opacity="$3"'); revmoo fucked around with this message at 19:28 on Feb 11, 2015 |
# ? Feb 11, 2015 17:12 |
|
Is there an easy way to detect whether somebody's viewing my site on a mobile browser or desktop/laptop? Specifically, I want to be able to send a GA event saying "Viewing on Desktop" or "Viewing on Mobile". I've considered using screen sizes, but that runs into problems on high-res tablets/low-res desktops. Maybe useragent strings would work better?
|
# ? Feb 12, 2015 06:14 |
|
Yeah that seems like a solved problem. Doesn't Google Analytics already do this?
|
# ? Feb 12, 2015 08:10 |
|
It does, and that's actually half the problem. According to my boss, our internal tracking isn't matching the GA data as far as visits from desktop/tablet/phone/telepathy are concerned, so he wants to beef up our tracking to find out where the mismatch comes from. Which means I have to know and log whether somebody's visiting from desktop/tablet/phone/tin cans on a string. I am quite happy to tell him it's impossible/impractical, but if there is a quick and easy way, fuckit, let's add it.
|
# ? Feb 12, 2015 10:30 |
|
There really isn't. A web browser can pretend to be whatever the gently caress it wants to be. Chrome calls itself "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" in its user agent string. The best you can get is rough metrics based on things you can generally measure, and its unlikely you'll find a way to be more accurate than what analytics tells you.
|
# ? Feb 12, 2015 10:48 |
|
|
# ? May 9, 2024 02:29 |
|
ugh this is a really basic question but I'm too dumb to figure it out. I want this layout, but with the sidebar going all the way to the top of the page (next to logo): http://jsfiddle.net/WCzaN/90/ I can do it by moving the sidebar to the top: http://jsfiddle.net/WCzaN/91/ but then when the site switches to one column for narrow screens all the sidebar content will be above the header, menu etc. which is no good (http://jsfiddle.net/WCzaN/94/). How do I keep the sidebar as the bottom element but make it float right all the way to the top of the page?
|
# ? Feb 12, 2015 11:52 |