Showing posts with label webdev. Show all posts
Showing posts with label webdev. Show all posts

slick - the last carousel you'll ever need

Fully responsive carousel. Scales with its container. Separate settings per breakpoint Uses CSS3 when available. Fully functional when not. Swipe enabled. Or disabled, if you prefer. Desktop mouse dragging Infinite looping. Fully accessible with arrow key navigation Add, remove, filter & unfilter slides Autoplay, dots, arrows, callbacks, etc...

http://ift.tt/1nWViS1

[Symfony2] How To detect not found Entity

Hello everyone,

Introduction

I've some news for all of you, I'm back !!! Last weeks resulted in a big change in my life, this is why I was really busy doing lot of not computing related stuff.

Now, it seems that the situation is being more "stable", so I'll have more time to redact tech Posts.

I've found a new job in Paris as a PHP web developer. I'll be working intensively on Symfony2 for the next weeks this is why you'll probably see more posts like this one.

The problem

You've been working on your super brand new Bundle that uses your killer Doctriner Entities and you want to add to your AppKernel.

Great, so you thought that you'll only have to add your Bundle in AppKernel.php bundles array and that's it.

In most of the cases it will work on the first attempt without problem. But in the Murphy's world (the real world) it's not like this.

If you get an error of type :

The class '*Entity' was not found in the chain configured namespaces ...

You've certainly forgot something in your configuration. So follow these simple checks to be sure that everything is alright.

The check list

You'll have to check a bunch of parameters to be sure that everything is alright :
  • Check that Bundle's class name is correct in your AppKernel and in the bundle's root class file.
  • Check that you've added your bundle in config.yml ORM configuration (specially if you had a MappingException error).
  • Check in your routings that Bundle name is correctly typed.
  • Check that you flushed the cache before testing.

Conclusion

Now with these simple checks you'll have no more trouble when adding your brand new killer bundle to take control of the world :)

Have fun.

[AngularJS] JSONP text/plain

Hi everybody,

I'm having a big change in my life these days this is why I wasn't this available to write Blog Posts but this didn't stop me working on my website.

I've added my portfolio using the Flickr API, you can have a look at it there. I thought it would be straightforward and be integrated in one hour max. The fact was that it costs me almost an entire day to integrate it... This is why I'm sharing my experiments with you.

So to put some context on this, I'm making my personal website using jekyll because of GitHub personal page hosting offering this option and angularjs for the easy to integrate philosophy. This is not a lot of libraries, this is why I need external services to collect informations to show on my website (I'm still waiting for a Blogger API if you read this Google hahaha).

Ok, then let's go back to the original problem, I figured that I had a Flickr showing my previous works (that I thought was lost in my laptop crash \o/), and I wanted to use the API to show it on my website.

First of all I initially intented to make a GET request to get my gallery data. This was not an option because of cross domain request limitation. I passed this issue rapidly by changing it to JSONP because cross domain request limitation do not apply for JSONP. Ok, we're getting to the point of this article, I wanted to share with you some JSONP specifics for you to understand why it allows us to make cross domain requests.

You probably know that javascript use the XMLHttpRequest for AJAX requests. This method limit the possible requests to the same domain as the webpage for security reasons. JSONP use a really simple trick to bypass this : in HTML you can include a javascript file from a remote domain using the script tag. So the idea is to include a javascript file making a call to a local callback function with the JSON in argument. To resume this I made a little diagram explaining it (sorry I only had paint available) :


Next I couldn't get API response to be parsed in object. Every single time I only got a string response. After a while making a lot of tests, I checked the webservice and I detected that response was encoded in mime-type text/plain. This was the answer, in angular, $resource don't parse well text/plain encoded data so I had to use the $http dependency to manually parse returned data. You can have a look to my website directives file and check the Flickr service for more infos.

I hope that this post will also help you to integrate easily bad mime-type encoded REST webservices and remember that everytime there is a solution. Have fun :)

FrontEnd Bootstrap

Hi,

I've just published my front-end developments setup on Github to let you guys play with it and make some tries.

The bootstrap comes with a Grunt script to generate outputs and is based on Typescript on the javascript side and Sass on the styling part. I also shipped the Angular framework and the Twitter bootstrap styling in it.

You can go directly to the project page if you do not want to get more details about why I chose this setup.

So, let me explain a little why I chose this setup and why this is my personal opinion of course…

First of all, on the javascript programming side I've chosen Typescript. It allows you to transform pure javascript programming through the superset and to declare strong typed variables. This last point is the most interesting, imagine that you have a thousand lines of code of pure javascript (the size of a real web application in production) that you've made 2 years ago and that you need to edit because of a hidden bug causing a BSoD in all main browsers… Having weak typed variables don't really allows you to ensure that they contains what they should contain and moreover you have to read all preceding source code to double check the expected variable type… Thanks to typescript you doesn't have this problem, you can explicitly declare your variables and simplify the source code maintenance. The other main superset used in the market is Coffeescript. Coffee script looks very good too, the only reason I haven't chosen this other option is for the syntax. I'm more used to Java/C# like programming but I think that Coffeescript will please all Ruby coders.

In order to speed up the coding process, I also like the Angular framework for his straight forward programmatic style. Integrating directly the view in the HTML DOM and the testing framework is a win to win brilliant concept. There is a LOT of others framework based on the MVC model but after using Backbone, Maria and Ember the easy and fast prototyping allowed with Angular conquered me.

On the Styling side, I used Sass as the superset of CSS. Why using a superset of CSS ? It allows you to define reusable blocks, variables and to define operations in different units. This is the main reasons I like to use Sass but the other most known CSS extension known as LESS is also a great alternative.
You can check both options and stick with the one you like the most. For me, it also was a syntax based decision.

I've also included the Twitter bootstrap package that help a lot to design web applications thanks to the predefined grid and components.

I'll let you clone, fork, try and test the bootstrap and I hope that it will please you as mush as myself :)

Have fun.

Cross Browser Testing Tool. 200 Browsers, Mobile, Real IE.

Test your website for cross-browser, cross-mobile compatibility. Debug HTML5, JavaScript & CSS across browsers. Test in Internet Explorer, Mobile Emulators and Mac OSX

http://www.browserstack.com/

Most seen