All the little things
A really great talk by Sandi Metz in which she refactors a nasty block of conditional code to a few small, understandable objects.
https://www.youtube.com/watch?v=8bZh5LMaSmE
Sevalla is the all-in-one PaaS for your web projects. Host and deploy your applications, databases, object storage, and static sites. Enjoy advanced deployment pipelines, a complete database studio, instant preview apps, and one-click templates. The pricing is simple: no hidden fees, no seat-based pricing, and you pay only for what you use. Get real human support from developers.
Get started now with a $50 credit at Sevalla.com.
A really great talk by Sandi Metz in which she refactors a nasty block of conditional code to a few small, understandable objects.
https://www.youtube.com/watch?v=8bZh5LMaSmE
If you have a form on your website where one of the fields is of the `type="password"`, the page will now be marked as insecure in your browser if it is served over a plain HTTP connection.https://ma.ttias.be/firefox-nightly-starts-marking-login-forms-in-http-as-insecure/
Stay up to date with all things Laravel, PHP, and JavaScript.
You can follow me on these platforms:
On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.
Every month I send out a newsletter containing lots of interesting stuff for the modern PHP developer.
Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.
Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.
"Password must contain 1 uppercase letter, 1 lowercase letter, and 1 number."http://ryanwinchester.ca/post/stop-forcing-your-arbitrary-password-rules-on-meWith a rule like that, the password
Abcd1234
would pass your validation, butmu-icac-of-jaz-doad
would not.
Ryan makes an excellent suggestion to replace password rules by an entropy estimator like Zxcvbn.
One of the most important endeavors in the PHP universe is the PHP Framework Interop group. The group consists of several maintainers of big PHP projects. Their aim is to find commonalities between their projects and find ways to work together. They do this by proposing and accepting PSR's, short for PHP Standard Recommendation.
One of the most important PSR's is PSR-4 (and the now deprecated PSR-0) which describes a way to autoload classes. Thanks to this standard packages can be easily be reused in many frameworks and projects. PSR-2 is another important one. It is a coding style guide and greatly improves readabiltiy of code when working with a bunch of developers. There are several other PSR's that have been accepted.
Today PHP-FIG published their new site. It features a beautiful design by Jonathan Reinink (he's the designer of the PHP League sites, author of Glide, and creator of the PHP Package checklist). If you use PHP in any way you owe it to yourself to check it out the new site.
httpie is a command-line http client, much like cURL or wget. Written entirely in Python (using requests for the backend and pygments for syntax highlighting), it’s well portable to many platforms, including the big three Windows, Linux and OSX.http://radek.io/2015/10/20/httpie/
A few days ago Jeffrey Way published an interesting lesson on how to integrate pjax with Laravel. Pjax is jquery plugin that leverages ajax to speed up the loading time of webpages. It works by only fetching specific html fragments from the server, and client-side updating only certain parts of the…
Developers can appear very unproductive at times, sitting staring at the screen with our headphones on and very little in the way of keyboard clackety-tap. This however is when we are doing our thinking, when we are building up, adding to and rearranging the mental model of how our code will work. This is the biggest and hardest part of development.http://thetomorrowlab.com/2015/01/why-developers-hate-being-interrupted/Imagine how it feels to have that interrupted at random by a telephone call or somebody walking over to talk to you. It’s horrible.
Maxime Fabre wrote a comprehensive tutorial on Webpack on the madewithlove-blog.
... Is Webpack a build system or a module bundler? Well, it's both– and by this I don't mean that it does both I mean that it combines both. Webpack doesn't build your assets, and then separately bundle your modules, it considers your assets to be modules themselves.http://blog.madewithlove.be/post/webpack-your-bags/
You've successfully created a PR and it's in the queue to be merged. A maintainer looks at the code and asks you to rebase your PR so that they can merge it.http://akrabat.com/the-beginners-guide-to-rebasing-your-pr/Say what?
The maintainer means that there have been other code changes on the project since you branched which means that your branch cannot be merged without conflicts and they would like to you to sort this out.
These are the steps you should take.
Matt Stauffer explains when and how you can leverage custom blade directives.
One of the greatest aspects of Laravel Blade is that it's incredibly easy to handle view partials and control logic. I find myself frequently extracting the contents of a loop out to a Blade partial and then passing just a bit of data into the partial.https://mattstauffer.co/blog/custom-conditionals-with-laravels-blade-directivesBut sometimes the repetitive code isn't the view itself, but the conditional logic I'm running.
Today I released a new package called laravel-fractal. It provides a Fractal service provider for Laravel. If you don't know what Fractal does, take a peek at their intro. Shortly said, Fractal is very useful to transform data before using it in an API. Using Fractal data can be transformed like…
HTTP/2 has a great feature called server push. It enables the server to send multiple responses in parallel for one request. In a blogpost on the Symfony Finland blog Jani Tarvainen demonstrates how to make use of server push with the Symfony Kernel.
$app->get('/images'), function () use ($app) {
$images = array('/images/1.jpg','/images/2.jpg','/images/3.jpg');
$response = new JsonResponse($images);
foreach($images as $image){
$response->headers->set('link','<' . $image . '>; rel=preload; as=image',false);
}
return $response;
Read the entire article for some more background info.
When working on JavaScript code you'll probably find yourself riddling the code with console.log
-statements when something is not working the way that you're expecting.
But did you know that there is a debugger
statement available? It has invokes any available debugging functionality. To put it otherwise: you can programmatically set a breakpoint for your debugger. It should work in any browser.
function potentiallyBuggyCode() {
debugger; //the debugger wil stop here
}
A great story by Derick Bailey of Watchmecode.net
The important lesson, ..., was that I owned up to the mistake, dug in and fixed it, and learned how to avoid the problem in the future. I was, in his mind, a better developer at the end of that day. I had survived a catastrophic crash of my own making and I had fixed the problem, learning some very valuable lessons in business down time and in code that day.http://derickbailey.com/email_archive/i-crashed-the-web-servers-of-a-100m-multi-national-corporation/
Here are the stages:
- Adopt personally
- Find the totem
- Repetitively broadcast
I had to learn about each stage separately. Each one contains activities that my 18-year-old self would never have believed were necessary.
Flux is both one of the most popular and one of the least understood topics in current web development. This guide is an attempt to explain it in a way everyone can understand.https://medium.com/@linclark/a-cartoon-guide-to-flux-6157355ab207
In this video Tom Scott explains why Chrome couldn't handle http://a/%%30%30 :
https://www.youtube.com/watch?v=0fw5Cyh21TE
In this excellent post Matthias explains why you can't put all your trust in cat
when inspecting a file:
https://ma.ttias.be/terminal-escape-sequences-the-new-xss-for-linux-sysadmins/
Let's all agree to never trust anything that has been posted on the internet without very thorough inspection. And let's especially agree to never run an arbitrary command or script found on the internet, without really close inspection.
I bet you have a headache when you need to mark some menu item as active. Is there any good way to solve this? Yes, there is – route attributes.http://blog.krucas.lt/2015/07/active-menu-state-using-route-attributes/