• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Web Design and Development |OT| Pixel perfect is dead, long live responsive design

Cyport

Member
I have a simple question regarding development websites.

I've noticed sometimes when a website is being built "example.com" it'll show a under construction page. If you go to "dev.example.com" it'll require a log-in and there you can access the website to build. How would this be done? Through DNS? I'm using Wordpress so would it involve making two instances and having to move databases over?
 

ferr

Member
Would this logic go into a service or controller?

I'm still an uber noob when it comes to Angular.

So basically,

/client/items-view/something.html
<ul><li ng-repeat='item in items'>{{item.Title}}</li></ul>

/client/items-view/something.controller.js
$scope.items = $get('/api/items') // ... calls out to api on server

/server/api/items/items.controller.js
$exports.index = function(req,res) { itemsModel.find(... yada yada look into mongo) }

and of course you have the itemsModel built in items/items.model.js (using mongoose) and you setup proper routing so that '/api/items/' exists and directs to the correct function in items.controller.js

Read through the structure of the MEANjs boilerplate project here- https://github.com/meanjs/mean It's an example project setup to use MEAN and it pretty much has examples for all of these structural concepts.
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
So basically,



and of course you have the itemsModel built in items/items.model.js (using mongoose) and you setup proper routing so that '/api/items/' exists and directs to the correct function in items.controller.js

Read through the structure of the MEANjs boilerplate project here- https://github.com/meanjs/mean It's an example project setup to use MEAN and it pretty much has examples for all of these structural concepts.

Thanks for the tip and the link.
I ended up getting it working last night while falling asleep and possibly drunk, before I saw your post. What I used was this. Not sure if it's the proper way, but it seemed to work.

/controllers/ThisCtrl.js
Code:
angular.module('ThisCtrl', [])
    .controller('ThisController', function($scope, $http) {
        $scope.postEntry = [];
        $http.get('/api/posts').success(function(post) {
            $scope.postEntry = post;
        })
    });

/views/this.html
Code:
<div class="list-group" ng-repeat="post in postEntry">
    <div class="list-group-item">
        <div class="row-picture">
            <img class="circle" ng-src="{{ post.img }}" alt="icon">
        </div>
        <div class="row-content">
            <h4 class="list-group-item-heading">{{ post.name }}</h4>
            <p class="list-group-item-text">{{ post.desc }}</p>
        </div>
        <hr />
        <a href="/contact" class="btn btn-inverse">I want</a>
        <div class="list-group-separator"></div>
    </div>
</div>
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
My code is usually disgusting, haha. I try to improve when I can, but this was hastily put together.

Thanks for the style guide though. That will help.
 

Ikuu

Had his dog run over by Blizzard's CEO
Speaking of Angular. What is the best way to do the following; I have a controller that grabs a users info (username and number of messages) and puts in the navigation bar, I want to check this on, essentially, every page. What is the best way to go about doing this?

Right I got it working with $broadcast:

Code:
function run($rootScope) {
	$rootScope.$on('$routeChangeSuccess', function (){
		$rootScope.$broadcast('checkForMessage');
	});
}

However because I have an ng-controller for the Navbar and ng-view it gets called twice. Any ideas on how I should get this working properly? Obviously removing the ng-controller or ngview fixes this, but at the moment I need both.
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
Speaking of Angular. What is the best way to do the following; I have a controller that grabs a users info (username and number of messages) and puts in the navigation bar, I want to check this on, essentially, every page. What is the best way to go about doing this?

Can you keep the navbar in a root view and then update it? It should carry across to all your separate views.
 

Everdred

Member
PHP:
I've been struggling with a website lately... The site is super fast when the user isn't logged in but slows down dramatically when SESSIONS start to be used after log in. I started using session_write_close(); immediately when possible but it doesn't seem to help.

SESSIONS are set to files in /tmp.

Anyone have any ideas on how to improve? I use 8 $_SESSION's per user. Would lowing that improve performance?
 
PHP:
I've been struggling with a website lately... The site is super fast when the user isn't logged in but slows down dramatically when SESSIONS start to be used after log in. I started using session_write_close(); immediately when possible but it doesn't seem to help.

SESSIONS are set to files in /tmp.

Anyone have any ideas on how to improve? I use 8 $_SESSION's per user. Would lowing that improve performance?

Are you sure that it's SESSIONS that slows your site down?

See:
http://stackoverflow.com/questions/1791843/php-session-slowdown
http://stackoverflow.com/questions/...e-sessions-slow-down-response-time-and-server
http://stackoverflow.com/questions/7835519/does-using-sessions-too-much-slow-down-performance-in-php

All signs point to nope
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
My friend and I just launched our first website/startup/company/whatever this morning.

It feels good, but it also utterly terrifying.
 
My friend and I just launched our first website/startup/company/whatever this morning.

It feels good, but it also utterly terrifying.

Good luck!

I'm so terrified even trying to launch it because it might not be "good enough". I have a demo page running and I'm waiting for the day when I fill it up with legit content.
 

Everdred

Member

Granadier

Is currently on Stage 1: Denial regarding the service game future
Good luck!

I'm so terrified even trying to launch it because it might not be "good enough". I have a demo page running and I'm waiting for the day when I fill it up with legit content.

Thanks!

We've only had two users so far. The whole project is being viewed as a learning experience first and foremost for us. I doubt it will be the last venture we create.
 

Merun

Member
Speaking of Angular. What is the best way to do the following; I have a controller that grabs a users info (username and number of messages) and puts in the navigation bar, I want to check this on, essentially, every page. What is the best way to go about doing this?

Right I got it working with $broadcast:

Code:
function run($rootScope) {
	$rootScope.$on('$routeChangeSuccess', function (){
		$rootScope.$broadcast('checkForMessage');
	});
}

However because I have an ng-controller for the Navbar and ng-view it gets called twice. Any ideas on how I should get this working properly? Obviously removing the ng-controller or ngview fixes this, but at the moment I need both.


It sounds like you have registered 2 listeners on an event so you may want to review your code. Just move your logic to the navbar controller which should be outside of your ng-view. No need to broadcast another event, or put the listener in the run function.

Code:
module.controller('navbarController', function($scope){
	$scope.$on('$routeChangeSuccess', function (){
		//do your retrieval logic here
	});
})
 

Ikuu

Had his dog run over by Blizzard's CEO
Thanks for that. I found out I had the links wrong and so it was hitting for example #/settings/ and then going to #/settings and so would run twice.
 

supergiz

Member
Is there a better way to do a table that is mobile responsive and displays vertically rather than horizontally? (Without extensive pho coding knowledge)

I'm using tablepress with the reponsiveness extension on wordpress.org. this is the table I'm trying to do it with. It's serviceable but looks horrible.

http://www.vrpill.com/milk-vr-videos/
 

WanderingWind

Mecklemore Is My Favorite Wrapper
Subscribing to this thread because I keep posting web design questions in programming and eventually they'll just murder me.
 

supergiz

Member
Btw I started a logo crowd source for my logo design on crowdspring. I know there are a lot of good graphic designers on GAF so let me know if you want to check it out and I'll pm you the details.
 

John_B

Member
iOS 8.3 Safari changed font-weight 200 for Helvetica Neue?

Top is 8.2 and bottom is 8.3

NUfBaw0.png


Funny thing is that it's now exactly like it is on Safari OS X. That 200 was perfection though. Is there anyway to get it back? Also is there any way to get it on OS X?

Edit: "HelveticaNeue-Thin" is the one. Weird bug.
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
Ok, admission of terrible testing practices time.

I've been working on a backend system written in PHP to connect a few different API's for the past couple of months. Since I have to hit the API's themselves, and they are remote and not ours, I have been doing testing my actually hitting the live API's with live site code. This is only possible because I'm working with an unfinished product that isn't public facing. But I want to learn how to do this more efficiently, and hopefully without having to actually hit anything live.


How do you guys handle testing PHP, or any language, when you have to talk with an external service? Specifically if you have to deal with webhooks.

I'm familiar with using Postman for some Node/Mongo work I've done, but I'm not sure if that's applicable when working with PHP....
 
At my job here the developers run a local sandbox that mimics the live servers, so I can make api calls and dump the results without doing any damage.
 

Daffy Duck

Member
I just have to vent, cleaning up after a couple of WP sites have been compromised to use the server to send out 800k+ worth of spam emails in two days has been a real headache.

Basically my first time having to do this and it's been a tough few days.
 

koene

Member
I just have to vent, cleaning up after a couple of WP sites have been compromised to use the server to send out 800k+ worth of spam emails in two days has been a real headache.

Basically my first time having to do this and it's been a tough few days.

Time to introduce security audits ;-)

Do you have any knowledge of how they got compromised? Security leak in the core of WP? I don't have experience with WP btw.
 

Daffy Duck

Member
I believe it was one of the plugins on the sites that allowed them to run the upload and they then uploaded a php file (which will be turned off when I put the site back) to the uploads directory and off they went.

I've seen the access logs of them fishing about through the various plugins then they got a few PHP files uploaded in various places.
 

koene

Member
I believe it was one of the plugins on the sites that allowed them to run the upload and they then uploaded a php file (which will be turned off when I put the site back) to the uploads directory and off they went.

I've seen the access logs of them fishing about through the various plugins then they got a few PHP files uploaded in various places.

So a plugin that allows php files to be uploaded? Sounds like the worst idea ever :) Or there was a lack of proper validation.

Also, shouldn't you be logged in in the backend to just access a WP plugin?
 

Daffy Duck

Member
The plugin doesn't allow PHP uploads per se, but the file uploader in WP (they need to be able to upload images) allowed the upload of php files to the upload directory, then that file was executed.

I didn't build the site, and it's about three year olds and was basically left on it own (plugins were out of date etc), basically the worst case scenario. :/

But I'm left to tidying it all up because the people who made it are no longer here.
 

koene

Member
The plugin doesn't allow PHP uploads per se, but the file uploader in WP (they need to be able to upload images) allowed the upload of php files to the upload directory, then that file was executed.

I didn't build the site, and it's about three year olds and was basically left on it own (plugins were out of date etc), basically the worst case scenario. :/

But I'm left to tidying it all up because the people who made it are no longer here.

That sucks man. Cleaning up shit afterwards is never fun. I hope you'll be done with it soon :)
 

Daffy Duck

Member
Yeah hopefully nearly done now so the end is in sight.

It's been one hell of a learning curve/journey. I've learnt a lot but would rather have learnt it another way. Lol.
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
Have an interview at a local creative webdev/marketing firm on Thursday for an internship.
Do any of you with experience have advice on interviewing for this type of position? So far I have my personal website/blog up to date, and I spent a night looking over their site code to get familiar with it and see if there was anything I could improve. (Ended up finding two things and wrote down the fixes)

Hoping this goes well!
 

smuf

Member
Have an interview at a local creative webdev/marketing firm on Thursday for an internship.
Do any of you with experience have advice on interviewing for this type of position? So far I have my personal website/blog up to date, and I spent a night looking over their site code to get familiar with it and see if there was anything I could improve. (Ended up finding two things and wrote down the fixes)

Hoping this goes well!

I have interviews on a regular basis since I do a lot of freelance work.

I wouldn't barge in telling them how to improve their codebase.

Generally I prepare a list of projects I want to show off beforehand, then run through them explaining their functionality and some of the technologies I used to build them.

Sometimes it's just the company boss or some hr-person interviewing - if they have any developers in the meeting it's good to give them some more in depth technical information.

Good luck!
 
Just wondering... is it good/bad practice to rely on CDNs for some stuff like fonts and JS frameworks? I keep thinking that there might be some oddball case where the user's network blocked Google for whatever reason.
 
Just wondering... is it good/bad practice to rely on CDNs for some stuff like fonts and JS frameworks? I keep thinking that there might be some oddball case where the user's network blocked Google for whatever reason.

It's a good practice with some bad qualities. Best case scenario most often is CDN's coupled with local fallbacks.
 

WanderingWind

Mecklemore Is My Favorite Wrapper
I worked all day on integrating a lightbox into our dated site for a special page. For some reason, the thumbnails were showing an invisible element across the width of the page, causing the imagines to basically tile vertically. I spent all day on it, then said to hell with it and stuck it into a table. But now the powers that be don't want that, they want the same image display that we've used since 2003.
 

grmlin

Member
I can't develop offline when using CDNs, so for development a clear "no" for me.

For production it could be an option. But with tools like browserify/webpack and npm, I don't want to mess around with any global dependencies anymore.
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
I have interviews on a regular basis since I do a lot of freelance work.

I wouldn't barge in telling them how to improve their codebase.

Generally I prepare a list of projects I want to show off beforehand, then run through them explaining their functionality and some of the technologies I used to build them.

Sometimes it's just the company boss or some hr-person interviewing - if they have any developers in the meeting it's good to give them some more in depth technical information.

Good luck!

Thanks! I'll leave the code bits I found out of the interview then. My thought process was that it would display that I was eager to learn and could look into a site. But I can totally see how it could come off as arrogant or barging in suggesting changes.

Instead I'll focus on preparing some projects of mine to talk about like you said.

edit: Interview went great!
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
If you don't enjoy HTML/CSS/JavaScript, or building websites, then yeah, webdev is probably not for you.

What is your motivation to do it if you don't enjoy it?


Edit: I failed to notice that you mentioned that you enjoy HTML/CSS. That was my bad.

There is plenty of work out there for people that enjoy just doing that stuff. It's generally referred to as Web Design as far as I understand it.
But you can be fully involved in the industry and be very successful without being an expert in JavaScript.

Sorry!
 
If you don't enjoy HTML/CSS/JavaScript, or building websites, then yeah, webdev is probably not for you.

What is your motivation to do it if you don't enjoy it?
My roommate loves HTML/CSS/SASS/etc. and designing websites but doesn't like JavaScript. Despite my encouragement he's currently going through his own webdev crisis as well.
 
Top Bottom