• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
[QUOTE=KinderBueno;46182192]Well I saw great deal for .com , only 8 Euro for first year.[/QUOTE] Namecheap does it for 8.40 eur/yr (7.75 for the first year with coupon OCTODO)
[QUOTE=KinderBueno;46183548]Holy shit, thats why my domain doesn't work yet.[/QUOTE] it should work, the cloud is pure magic
Got the nginx installed. Holy shit never knew Linux is so fun to use. Always though it's cooler to have interface, seems like not :v:
This is bullcrap, just spent 3 hours trying to fix PHP message: "Access Denied". Basically I want .php files to work, now if I have index.php and index.html in root of website, it says Access Denied. If I remove index.php it loads html file fine. Basically any PHP file just says Access Denied. Tried all these solutions already: [url]http://stackoverflow.com/questions/23390531/access-denied-403-for-php-files-with-nginx-php-fpm[/url] Still says that. Anything else to try? P.S - took 30 mins to make FTP work perfectly and let me upload files to website, and it takes 3 hours to install PHP. No logic.
[QUOTE=KinderBueno;46187717]This is bullcrap, just spent 3 hours trying to fix PHP message: "Access Denied". Basically I want .php files to work, now if I have index.php and index.html in root of website, it says Access Denied. If I remove index.php it loads html file fine. Basically any PHP file just says Access Denied. Tried all these solutions already: [url]http://stackoverflow.com/questions/23390531/access-denied-403-for-php-files-with-nginx-php-fpm[/url] Still says that. Anything else to try? P.S - took 30 mins to make FTP work perfectly and let me upload files to website, and it takes 3 hours to install PHP. No logic.[/QUOTE] You're new to Linux. It's what to expect. Most of us who has used linux for awhile writes shell scripts which simply deploy our entire server structure. Btw, you don't really need FTP, you could always use the built-in SFTP protocol instead. A bit slower in response but more secure. Linux is all about logging really. Everything is logged in /var/log. For example, you can find access errors in [B]/var/log/nginx/access.log[/B] and errors in [B]/var/log/nginx/error.log[/B]. Go through them and see if you can find anything. Could be that your nginx and PHP installations are running on different users.
Okay checked the error, it says: 2014/10/09 07:37:14 [error] 848#0: *235 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Unable to open primary script: /var/www/mysite.com/html/new.php (Permission denied)" while reading response header from upstream, client: 176.61.18.193, server: mysite.com, request: "GET /new.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "mysite.com" P.S - nvm, got it fixed. Shit 3 hours wasted last night trying to change php/nginx settings, while it turned out to be that new.php had permission set to 400, now it's 775. Btw, how can I make it so when I create folder/file on filezilla it's automatically 775? I don't want to log into terminal everytime I want to access file.
[QUOTE=NotExactly;46071941]Is there like a repository anywhere of official vector logos - you know how on loads of tech websites they have logos of companies that use their product (e.g. [url]http://www.git-tower.com/[/url]) - does anyone know where they get them? I imagine on some sites they maybe just contact the company and ask for the vectors or whatever but surely not everyone can do that - I don't want to just take them off google images or wikimedia or whatever for licensing reasons.[/QUOTE] I know I'm 2 weeks late but I just found [url=http://www.brandsoftheworld.com/]this[/url] if you still need it
Anybody know why my array is undefined inside of this SetTimeout? I've never really fully understood scopes and things. I'm trying to fade a bunch of circles in with an offset of about 10 milliseconds each. If I get rid of the SetTimeout, then all of the circles fade in all at once, but as soon as I put it in, my array is undefined within the SetTimeout function. [code] Snap.load('img/ppFull-Logo.svg', function(f) { var innerCircle = new Array(145); for (var i = 0; i < 145; i++) { innerCircle[i] = f.select("#InnerCircle"+(i+1)); setTimeout(function() { console.log(innerCircle[i]); s.append( innerCircle[i].animate({ "fill-opacity": 1 }, 500) ); }, (i*10)); } [/code] [editline]10th October 2014[/editline] OK wow I just realized how dumb I am. SetTimeout will wait until the loop is done (because thats what it does... duh) and will only execute when var [i]i[/i] is at its last iteration. I'll have to find another way of doing this with Snap.svg callbacks.
Just a side question guys: I got Node.JS and Socket.io installed, works perfect and I kind of got the main understanding how to work with sockets and jade. But: I users to login and load their data/avatars. For this I assume I should use PHP (assume), is there any way to integrate jade and php together on one page? so that like first PHP loads all elements then jade initializes main chat window with messages, users online etc... ? I have a simple solution but not sure if it's a good practice: Have a main site as index.php where user logins, if user logins successfully it redirects to chat and user starts to chat. Is there better solution?
you can also try a non-php approach. there's passportJS for node that you can use for auth, if you're using express. since you're using socket.io there's also a passport-socketio module for easy integration with sockets
[QUOTE=KinderBueno;46196093]Just a side question guys: I got Node.JS and Socket.io installed, works perfect and I kind of got the main understanding how to work with sockets and jade. But: I users to login and load their data/avatars. For this I assume I should use PHP (assume), is there any way to integrate jade and php together on one page? so that like first PHP loads all elements then jade initializes main chat window with messages, users online etc... ? I have a simple solution but not sure if it's a good practice: Have a main site as index.php where user logins, if user logins successfully it redirects to chat and user starts to chat. Is there better solution?[/QUOTE] Just as Cuel said, I recommend you to use PassportJS in combination with the Socket.io strategy. I am using the same and I must say it works fine.
How would I go about setting something like rpi.limonene.net to redirect to my home IP if I only have a dynamic IP? CNAME in cpanel's DNS section?
[QUOTE=KinderBueno;46196093]Just a side question guys: I got Node.JS and Socket.io installed, works perfect and I kind of got the main understanding how to work with sockets and jade. But: I users to login and load their data/avatars. For this I assume I should use PHP (assume), is there any way to integrate jade and php together on one page? so that like first PHP loads all elements then jade initializes main chat window with messages, users online etc... ? I have a simple solution but not sure if it's a good practice: Have a main site as index.php where user logins, if user logins successfully it redirects to chat and user starts to chat. Is there better solution?[/QUOTE] Go check out more node tutorials. There is zero reason to bring PHP in to this and it's really the wrong thing to do unless you know EXACTLY why you would need to do it.
As you guys know Linux: How do you actually keep a service alive? I launch chat server and it works fine, but when no user visits the page for some time the service goes to sleep and website doesn't work anymore. I heard about thing like Heartbeat before, but what is it exactly? How does that work?
[QUOTE=Cakebatyr;46200935]How would I go about setting something like rpi.limonene.net to redirect to my home IP if I only have a dynamic IP? CNAME in cpanel's DNS section?[/QUOTE] You're looking for dynamic DNS. On my RPi I have a bash script in /etc/cron.daily that sends my home IP to Namecheap's DynDNS service if it differs from the currrent A record. Going from your whois info, you're also on Namecheap so it would probably look something like this: [code] #!/bin/sh # Namecheap Dynamic DNS Updater # Change the four lines below and put this in your crontab HOST="rpi" DOMAIN="limonene.net" NAMESERVER="dns1.namecheaphosting.com" PASSWORD="<apikey>" # get dns record and current dynamic ip # we ask the nameserver directly to avoid caching issues REC=$(nslookup $HOST.$DOMAIN $NAMESERVER|tail -2|grep A|sed s/[^0-9.]//g) CUR=$(curl -s ipecho.net/plain|sed s/[^0-9.]//g) # if the ip has changed, update record and log to syslog [ "$CUR" != "$REC" ] && { curl -s "dynamicdns.park-your-domain.com/update?host=${HOST}&domain=${DOMAIN}&password=${PASSWORD}&ip=${CUR}" logger "DynDNS: Record updated from $REC to $CUR" } || { logger "DynDNS: Record matches current address; no update" } [/code]
I've been up for way too long... I have no idea what's wrong with my style sheet [code]@font-face { font-family: HaxrCorp; src: url('file://C:/Users/Scratch/Documents/GitHub/Deshou/Deshou%20STEAM/resource/fonts/haxrcorpttf.ttf'); } * { font-family: HaxrCorp; }[/code]
"file://C:/Users/Scratch" you forgot to upload it to your server
[QUOTE=jung3o;46218028]"file://C:/Users/Scratch" you forgot to upload it to your server[/QUOTE] It's not something that runs on a server
[QUOTE=Scratch.;46218278]It's not something that runs on a server[/QUOTE] Browsers are pretty picky when it comes to loading local files, try using a relative path
[QUOTE=Scratch.;46218278]It's not something that runs on a server[/QUOTE] I think that if the document are in "Deshou STEAM" you can just do src: url('resource/fonts/haxrcorpttf.ttf'); I haven't used that too much because I had been used to just doing something like [B]/[/B]resource/font.ttf (which searches relative to the root directory) [editline]We still cool[/editline] Darn
[QUOTE=gokiyono;46220356]I think that if the document are in "Deshou STEAM" you can just do src: url('resource/fonts/haxrcorpttf.ttf'); I haven't used that too much because I had been used to just doing something like [B]/[/B]resource/font.ttf (which searches relative to the root directory) [editline]We still cool[/editline] Darn[/QUOTE] Tried that first, since webkit.css is stored in /resource, my path was './fonts/font.tff' [editline]13th October 2014[/editline] Seems to work, Must be a problem as it may be using the URL from the browser, not the file. Idk how these work [code]@font-face { font-family: HaxrCorp; src: url('http://5crat.ch/haxr/haxrcorpttf.ttf'); }[/code]
[CODE] <style type='text/css'> .opt22{ font-weight:bold; } </style>[/CODE] [CODE] <select name="URL" onchange="window.location.href=this.form.URL.options[this.form.URL.selectedIndex].value"> <optgroup label="foo"> <option class="opt21" value="url1" disabled>bar</option> <option class="opt22" value="url2" >baz</option> <option class="opt23" value="url3" disabled>qux</option> <option class="opt24" value="url4" disabled>norf</option> </optgroup> </select> [/CODE] the selectable option baz is not appearing as bold in my dropdown. is applying css classes to select options not supported in chrome 41? [editline]14th October 2014[/editline] also yes the <style> is in my <head> tags [editline]14th October 2014[/editline] in this case, "beginner's guide to foo" should be bold and nothing else [img]http://i.imgur.com/X0udX1e.png[/img] [editline]14th October 2014[/editline] new foo, old foo, deprecated, premium, and meta foo are only bold because they're optgroups and not options
so trying out a MEAN stack without using mean.io since i feel i should get around to knowing all the stuff before i move on to that kind of automation, currently working on grunt current setup is: dev: uses src folder, runs jshint, tests, watch and nodemon dist: uses dist folder, runs concat, uglify, copy (currently for ng-templates, will probably use html2js later on), & forever currently the index.html just loads scripts in the src folder for jquery, ng etc. i want the dist index.html to get CDN script files instead and that's not an issue using grunt-process-html but i would like some more automation, such as a scripts.json file that grunt outputs in the index.html. so i found npm-assets-manager that could be used in combination with swig for nice clean outputs. the problem seems to be that grunt-swig isn't used that much and i would like to know if there's any reason for that? or if there's better alternatives. it must be able to take grunt pkg.version that's appended to some files in dist.
Does anyone know how i would be able to copy and paste math from a CengageBrain ebook? (it's viewed in a browser). It lets me copy but when i paste in Word, Google docs, or writeLaTeX, i get boxes, (which i think means the font's missing?). For context, it's for Calculus 2 extra credit. The task is to make a sheet of all the differentiation and integration rules, including transcendental and hyperbolic functions; so this would save me a TON of time. Thanks guys.
[QUOTE=Neckbird;46251696]Does anyone know how i would be able to copy and paste math from a CengageBrain ebook? (it's viewed in a browser). It lets me copy but when i paste in Word, Google docs, or writeLaTeX, i get boxes, (which i think means the font's missing?). For context, it's for Calculus 2 extra credit. The task is to make a sheet of all the differentiation and integration rules, including transcendental and hyperbolic functions; so this would save me a TON of time. Thanks guys.[/QUOTE] Paste it into a text field that's not a WYSIWYG editor. Like Notepad or sublime for example.
[QUOTE=Neckbird;46251696]Does anyone know how i would be able to copy and paste math from a CengageBrain ebook? (it's viewed in a browser). It lets me copy but when i paste in Word, Google docs, or writeLaTeX, i get boxes, (which i think means the font's missing?). For context, it's for Calculus 2 extra credit. The task is to make a sheet of all the differentiation and integration rules, including transcendental and hyperbolic functions; so this would save me a TON of time. Thanks guys.[/QUOTE] You can also screenshot all the equations and just make a sheet that way, I don't see why they HAVE to be editable.
[QUOTE=Svenskunganka;46252175]Paste it into a text field that's not a WYSIWYG editor. Like Notepad or sublime for example.[/QUOTE] I tried notepad but i still get the boxes. Anyway, I found a program called InftyReader that lets me open the equations in word. Except for some oddly placed spaces, it's exactly what i was looking for. So it's all good.
It's probably LaTeX. There are plenty of editors out there word won't cut it tho. [editline]16th October 2014[/editline] Nvm you tried that. I missed that, my bad.
I need some help with JSON in PHP. I'm trying to use the League of Legends API to make a website, and I don't know how to get information out of an object it returns. For example if I put a summoner name in I get back [code]{"mrretardo": { "id": 309389, "name": "Mr Retardo", "profileIconId": 580, "revisionDate": 1413542700000, "summonerLevel": 30 }}[/code] so how do I get "id" from this?
[QUOTE=Pat.Lithium;46259640]I need some help with JSON in PHP. I'm trying to use the League of Legends API to make a website, and I don't know how to get information out of an object it returns. For example if I put a summoner name in I get back [code]{"mrretardo": { "id": 309389, "name": "Mr Retardo", "profileIconId": 580, "revisionDate": 1413542700000, "summonerLevel": 30 }}[/code] so how do I get "id" from this?[/QUOTE] [code] $json_array = json_decode(<json string>, true); $id = $json_array['mrretardo']['id']; [/code]
Sorry, you need to Log In to post a reply to this thread.