• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
[QUOTE=KmartSqrl;43824981]Git is way better to use for deployments than something like FTP. I use git to deploy every site that I have online right now (it's a more complex process than just 'git push' to the server, but git is definitely how the files get there)[/QUOTE] Could you expand on this a bit? I'm somewhat interested on not having to upload new versions here and there AND git push, so I'd love to know shortcuts for it.
[QUOTE=Coment;43825174]Could you expand on this a bit? I'm somewhat interested on not having to upload new versions here and there AND git push, so I'd love to know shortcuts for it.[/QUOTE] I deploy everything with [url=http://capistranorb.com/]Capistrano[/url] right now. It's kick ass. Really easy to get it working out of the box for Ruby/Rails apps, but you can definitely use it to deploy anything (and can probably find tutorials for whatever you want to deploy with it). Deployment is something that requires essentially the same steps every time you do it (update code, update db, restart app, etc) which means it's something you should be automating.
[QUOTE=KmartSqrl;43824981]Git is way better to use for deployments than something like FTP. I use git to deploy every site that I have online right now (it's a more complex process than just 'git push' to the server, but git is definitely how the files get there)[/QUOTE] I've actually done this quite a bit, since it is a pleasure to work with git in this aspect. For example, for one project, I created a bare repository in ~/notify.git, and because of the way git works, git push my-server:notify.git works out of the box. Plus, I defined the post-receive hook as [url=https://gist.github.com/redjazz96/56bcab97188a2ecf8831]this[/url], which built the project and started the server. It's brilliant.
[QUOTE=Ac!dL3ak;43826890]I've actually done this quite a bit, since it is a pleasure to work with git in this aspect. For example, for one project, I created a bare repository in ~/notify.git, and because of the way git works, git push my-server:notify.git works out of the box. Plus, I defined the post-receive hook as [url=https://gist.github.com/redjazz96/56bcab97188a2ecf8831]this[/url], which built the project and started the server. It's brilliant.[/QUOTE] You definitely can do that, but I think a tool like cap is more flexible since it's made for doing this. It's pretty widely used too, so there's already code written for lots of common deployment tasks.
Another quick question, I'm making a poll system (php) for a site admin control panel where they can create and edit polls. How would I go about making site users able to vote only once? I don't want visitors to have to make accounts to answer these polls because that's just tedious for them to do. Collecting their IP with MySQL doesn't seem ethical and I was thinking local storage, but I'm not sure if that's the best way to do it.
[QUOTE=Cep.;43833117]Another quick question, I'm making a poll system (php) for a site admin control panel where they can create and edit polls. How would I go about making site users able to vote only once? I don't want visitors to have to make accounts to answer these polls because that's just tedious for them to do. Collecting their IP with MySQL doesn't seem ethical and I was thinking local storage, but I'm not sure if that's the best way to do it.[/QUOTE] With those options off the table, maybe cookies? If you really want them to vote once I highly recommend you reconsider your options.
[QUOTE=asantos3;43833655]With those options off the table, maybe cookies? If you really want them to vote once I highly recommend you reconsider your options.[/QUOTE] I looked around at a couple of poll sites, most notably ESPN's polls, and the majority use cookies like you suggested. I'll try that out, thanks!
You know if someone disabled cookies in their browser they could just keep pressing vote as many times as they want? For most people they won't know this but you're going to get the person who knows this
[QUOTE=djjkxbox360;43834396]You know if someone disabled cookies in their browser they could just keep pressing vote as many times as they want? For most people they won't know this but you're going to get the person who knows this[/QUOTE] In theory, couldn't I set a cookie value then immediately check it to see if the value was set correctly, then disable voting to those who wouldn't get the value correct?
[QUOTE=Cep.;43834768]In theory, couldn't I set a cookie value then immediately check it to see if the value was set correctly, then disable voting to those who wouldn't get the value correct?[/QUOTE] You could always disable cookies after that, or just remove whatever cookie you placed once voting.
[QUOTE=Cep.;43833117]Collecting their IP with MySQL doesn't seem ethical[/QUOTE] Don't see what's wrong with storing their IP with ip2long as well as also storing a cookie maybe? Atleast then you'll know it'll be much harder to spam votes as a proxy or something would need to be used and I doubt people would bother doing that.
[QUOTE=seanm07;43834879]Don't see what's wrong with storing their IP with ip2long as well as also storing a cooking maybe? Atleast then you'll know it'll be much harder to spam votes as a proxy or something would need to be used and I doubt people would bother doing that.[/QUOTE] Yeah it's not going to be polls that are extremely important, more like the ones you see on the sidebars of sites asking small opinion questions about the site/upcoming events. I'd never heard of ip2long before though and storing it serverside seems more secure.
[QUOTE=Cep.;43833117]Another quick question, I'm making a poll system (php) for a site admin control panel where they can create and edit polls. How would I go about making site users able to vote only once? I don't want visitors to have to make accounts to answer these polls because that's just tedious for them to do. Collecting their IP with MySQL doesn't seem ethical and I was thinking local storage, but I'm not sure if that's the best way to do it.[/QUOTE] I don't think collecting an IP when someone accesses your site is unethical at all. It's your website, you have the right to know who's accessing it and where it's being accessed from. That being said, I don't think JUST looking at their IP is the best route because lots of people have dynamic IP addresses. I think you'll want to take a combination of different approaches, definitely cookie them, but I would also record IPs and reject votes that repeatedly come from the same IP in a short timespan.
When re-writing urls does it have any effect on what the php script sees when reading $_GET's?
I'm having a problem with Notepad++ jumping to a random spot in the document on my home computer, I've never had a problem with Notepad++ at work, but when I press caps lock then another key quickly it just moves the text cursor for some reason. (I never use shift for capital letters, I've always been used to just pressing caps lock, then the key then caps lock again.. Seems like it would be slow but I've always been used to doing that for some reason which is why this is really annoying) Anyone know what the problem is? Not sure if this matters but I have Windows 7 with the latest update of Notepad++ using a Microsoft Sidewinder x6 keyboard and I have a Bamboo tablet connected to the PC too. I have my keyboard, mouse and tablet all connected to the same USB HUB. [B]Edit: [/B]I think I fixed it, there was 2 plugins that had updates available in the plugin manager, DSpellCheck and MIME Tools this seems to have fixed it but it may also be that restarting the program temporarily fixes it until I do a certain action? I tried restarting it before but I only now just realised what was causing the text cursor to randomly jump to a different place in the document. [B]Edit 2: [/B]The bug has came back so updating those plugins didn't fix it, I've just been typing and collapsing methods which is what I tried after updating. I can't just keep restarting Notepad++ to fix it :/
[QUOTE=gokiyono;43837689]When re-writing urls does it have any effect on what the php script sees when reading $_GET's?[/QUOTE] Can't you just store them in variables before you change the URL?
[QUOTE=djjkxbox360;43840966]Can't you just store them in variables before you change the URL?[/QUOTE] I was under the impression you did it with a .htaccess file I am a bit confused now [editline]n[/editline] Suppose I have mysite.com/page.php?rank=something and change it to mysite.com/something Is it still possible to $_GET['rank'], or would I have to manually get the url and split it up?
[QUOTE=gokiyono;43841225]I was under the impression you did it with a .htaccess file I am a bit confused now [editline]n[/editline] Suppose I have mysite.com/page.php?rank=something and change it to mysite.com/something Is it still possible to $_GET['rank'], or would I have to manually get the url and split it up?[/QUOTE] Yeah, it's still possible. mod_rewrite only changes what the user sees on their browser bar; the original url remains unchanged, in the eyes of php.
[QUOTE=Coment;43841407]Yeah, it's still possible. mod_rewrite only changes what the user sees on their browser bar; the original url remains unchanged, in the eyes of php.[/QUOTE] That's nice to know, thanks
How do I go about finding a good web designer?
[QUOTE=bopie;43844373]How do I go about finding a good web designer?[/QUOTE] actually offer something reasonable if you expect something for $50, forget it and go to themeforest
Sorry - where should i look with a $2k budget?
[QUOTE=bopie;43844491]Sorry - where should i look with a $2k budget?[/QUOTE] [url]https://www.odesk.com/[/url] [url]http://www.freelancer.com/dashboard/[/url] To name a few.
I am so terribly lost. I know there's a thing against helping people with their homework here, but it's more math than JavaScript. The objective for this step of the problem is to do integer division where I need to generate two random numbers between one and a hundred where A) the first number must be larger than the second and B) The two numbers, when divided, also produce an integer. Attempted a while loop to keep generating until such conditions apply... [code] while ( (num1 <= num2) && ((num2 % num1) != 0) ) { // Should exit when num2 is greater than num1 AND when the division returns zero remainder (no decimal). // But it doesn't fulfill the latter. num1 = parseInt(Math.floor(Math.random() * 100) + 1); num2 = parseInt(Math.floor(Math.random() * 100) + 1); } // End WHILE [/code] I think it has to do with the conditions. [b]num1[/b] and [b]num2[/b] are supposed to be worked as [b]num1 [i]divided by[/i] num2[/b] but the answer when divided aren't integers. [editline]e[/editline] tl;dr I don't need something to produce 19 / 4 = 4 via Math.floor(), but to check whether or not two numbers when used in a division problem have no remainder. Problems like 16 / 4 instead of 64 / 51. [editline]e[/editline] Why do I always find the solution almost immediately I post a thing for help? The problem that I was checking if num1 < num2 AND if num1 % num2 had no remainder, which returned false if one or the other happened and should have used an OR instead. There's a little technique called Talking to the Rubber Duck.
[QUOTE=MuffinZerg;43844848][url]https://www.odesk.com/[/url] [url]http://www.freelancer.com/dashboard/[/url] To name a few.[/QUOTE] These are great if you want bottom of the barrel, half-assed, rushed work
I have 53 hex code colors I want them in rainbow order... lol... What is the easiest way to do this? (not by hand)
I have never wanted to kill someone more over something as much as this but 2 hours later and I am nowhere. I'm trying to find text between html tags. The html is a string. The tags are <td></td> and all it returns is null. [code] var insultSite = 'http://www.insultgenerator.org/'; var result; var reg = /<td>([abc])<\/td>/g; $.get( insultSite, function( data ) { data = String( data ); result = data.match( reg ); document.write( result ); }); [/code] I tried lots of other things besides [abc]. That is just the last thing I tested. I'm new to all this by the way. [editline]9th February 2014[/editline] It does get me the html but after I try to do the match it just doesn't return what I want only null.
You could try to get the position of <td> and the position of </td> via a strpos equivalent and then cut the string out from that position. If you don't want the td and /td you just have to add 4 characters and remove 5 characters from the cut out string so they're outside of it.
How do i get started in web development? What should i know and what tools do i use. I'm especially interested in WebGL. I know C++ and some OpenGL, so WebGL shouldn't be the major problem, just the stuff around it.
[QUOTE=Sergesosio;43858114]How do i get started in web development? What should i know and what tools do i use.[/QUOTE] HTML, CSS, PHP, JavaScript. Also I recommend using Sublime Text 2 for coding. Start with HTML/CSS, your choice from then if PHP or JavaScript, I guess that's just a personal taste on what you want to do next.
Sorry, you need to Log In to post a reply to this thread.