Changing live audio with JavaScript
In this talk Sam Bellen demonstrates how to use JavaScript's web-audio-api to transform audio in realtime. Presentations with guitars are cool. Love the Metz t-shirt.
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.
In this talk Sam Bellen demonstrates how to use JavaScript's web-audio-api to transform audio in realtime. Presentations with guitars are cool. Love the Metz t-shirt.
Sandi Metz solved the Roman numerals kata in a very interesting way. Along the way she makes the case for keeping code simple.
The desire for simplicity means that I abhor special cases. I am willing to trade CPU cycles to achieve sameness. I'll happily perform unnecessary operations on objects that are already perfectly okay if that lets me treat them interchangeably. Code is read many more times that it is written, and computers are fast. This trade is a bargain that I'll take every time.
http://www.sandimetz.com/blog/2016/6/9/make-everything-the-same
Amen to that. I did not know that additive Roman numerals are perfectly valid.
If you want to read more posts by Sandi, be sure to subscribe to her newsletter.
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.
Lately I've been working a lot with collections in Laravel. If you're not in the know: a collection is a sort of super charged array with a lot of powerful functions to transform the data inside it. The only thing I found a bit of a hassle is how to debug the various steps in a collection chain.…
Davey Shafik dissects the values of several tech communities in a new post on his blog.
Just like the programming languages that are the centers of our communities, each community has its own set of rules and idioms — they have a real life syntax.In my (almost) three years of being in a developer relations type role I have attended events in several communities and have observed how they differ from my primary community (PHP). As I’ve tried to understand those differences and the reasons behind them, I have had many discussions with members of many more communities also.
After attending my first PyCon (US) I was struck by just how welcoming and diverse the community is and had many conversations trying to understand why this is. This is not what this post is about. This post is about conferences specifically, and how communities place different priorities on different things when it comes to how they run, organize, speak at, and attend events.
https://daveyshafik.com/archives/69985-the-syntax-of-tech-communities.html
On his blog Chris White explains how to upload files directly to S3. Pretty cool!
Most of us know of Amazon S3, a cloud based storage service designed to store an unlimited amount of data in a redundant and highly available way. For most situations using S3 is a no brainer, but the majority of developers transfer their user's uploads to S3 after they have received them on the server side. This doesn't have to be the case, your user's web browser can send the file directly to an S3 bucket. You don't even have to open the bucket up to the public. Signed upload URLs with an expiry will allow temporary access to upload a single object.
Over at the excellent dotdev.co Amo Chohan wrote an article on how to structure code when you need many filters on an Eloquent model.
I recently needed to implement a search feature in an events management project I was building. What begun as a few simple options (searching by name, e-mail etc), turned into a pretty large set of parameters. Today, I’ll go over the process I went through and how I built a flexible and scalable search system. For those of you who are eager to see the final code, head over to the Git repository to see the code.
https://dotdev.co/writing-advanced-eloquent-search-query-filters-de8b6c2598db
At Spatie we have a tv screen against the wall that displays a dashboard. This dashboard displays the tasks our team should be working on, important events in the near future, which music is playing at our office, and so on. Here's what it looks like: We've opensourced our dashboard, so you can view…
The grid layout for dashboard.spatie.be was conceived with 3 simple ideas in mind: The layout has to be lightweight on the client side: no JavaScript calculations or full-blown grid library should be used. The HTML structure in the templates has to be clean, without extra markup for rows and…
The release of Laravel 5.3 is just around the corner. Over at Laravel News Eric L. Barnes made a nice overview of the new stuff coming in the framework.
Laravel 5.3 is currently in development and with all new Laravel releases, new features are being teased out as they are added. Here is a quick look at some of these new features.
https://laravel-news.com/2016/06/look-whats-coming-laravel-5-3/
A few weeks ago the Frontend United Conference was held in Ghent, Belgium. The entire development team at Spatie attended the conference. Though it certainly was fun to go to a conference with the entire team we were left a bit underwhelmed. Some of the talks were very short and some speakers seemed a bit unprepared.
The organisers have begun posting video's of all sessions to YouTube. In my opinion the following three talks rose above the rest.
1: Harry Roberts gave a talk were he demonstrated that programming best practices apply to writing CSS as well.
2: Christian Heillman talked about web obesity and gave a few tips on how to optimize the size of images.
3: Mathias Bynens showed how unicode support in JavaScript is broken and what common pitfalls are when working with special characters. Rather than just complaining about it, he offered some kick ass self-made solutions.
(the video for this session hasn't been posted yet, this is a video of the same talk at another conference)
Today we released our new package called laravel-blade-javascript. It provides you with a javascript Blade directive to export PHP variables to JavaScript. So it basically does the same as Jeffrey Way's popular PHP-Vars-To-Js-Transformer package but instead of exporting variables in the controller…
Jerome Dalbert on his blog:
Splitting your Rails controllers when they have a very specific scope, too much logic, or too many mixed concerns can have a lot of good side effects in your code.It doesn’t mean that you never abstract. It just comes later down the road. At some point some logic needs to be shared by several controllers. Sometimes even a splitted controller with only one public method gets too big. Et cetera. This is where concerns, model methods, possibly background jobs, and even sometimes service objects (hopefully not too many) come into play.
The more your app grows, the more time you will need to spend to understand it, no matter how clean the code is. But splitting your controllers makes things easier.
http://jeromedalbert.com/how-dhh-organizes-his-rails-controllers/
Apart from simplicity, another advantage of using process substitution is Bash will automatically parallelize your tasks. Returning to our first example…
$ diff <(curl http://somesite/file1) <(curl http://somesite/file2)
… Bash will run both those curl commands in parallel. Sweet huh?
https://medium.com/@joewalnes/handy-bash-feature-process-substitution-8eb6dce68133#.bsbczvvc9
Jordi Boggiano, the creator and maintainer of Composer and Packagist, released some fresh statistics on which PHP version composer users are running.
A few observations: 5.3 dropped to almost nothing which is great news! 5.4 is also down by almost 10% and is definitely on the way out. 5.5 is still big but less so, while 5.6 got a huge boost to become the main version. The big surprise is that we have 20% of PHP7 already! That is great news only six months after this major release came out.
20% sounds really great, but I suspect that this number is slightly optimistic. Many developers who are running PHP 7 in their dev environment use PHP 5.X in production.
Over on the package side only ±20% of all packages require PHP 5.5 or above and only 1% requires PHP 7. Jordi has this to say about that:
All in all, it seems like package requires are way behind actual version usage, so I would like to encourage everyone to be a bit more aggressive in bumping PHP requirements when tagging new major releases of their libs.
That's great advice. The bulk of the newly released Spatie packages require PHP 7. In my opinion you'd do our ecosystem a favour by picking PHP 7 as a minimum requirement when you are creating a new package.
Read Jordi's entire post on his blog for more details: https://seld.be/notes/php-versions-stats-2016-1-edition
Matt Stauffer has been working on a book titled "Laravel: Up and Running" which will be released soon. In a post on his blog Matt shares a few hidden Laravel gems that he discovered while writing his book.
No blog post could contain all of the new things I learned from writing this book. I've been using—and teaching about—Laravel for years, and I was still shocked by how many tools and helpers and features I discovered.Here are a few that stand out to me that I had never seen prior to writing the book.
https://mattstauffer.co/blog/things-i-didnt-know-laravel-could-do
Phil Sturgeon provides a good explanation on the why and how of middlewares in PHP.
Recently there has been a lot of buzz about HTTP middleware in PHP. Since PSR-7 was accepted, everyone and their friend Sherly has been knocking out middleware implementations, some of them stunning, some of them half-arsed, and some of them rolled into existing frameworks. HTTP Middleware is a wonderful thing, but the PHP-FIG is working on a specific standard for middleware, which will standardise this mess of implementations, but some folks don't seem to think that would be useful.Let's look into middleware a little closer, to show you why it's something to smile about.
https://philsturgeon.uk/2016/05/31/why-care-about-php-middleware/
Sebastian De Deyne, developer at Spatie and creator of several Spatie packages, has written a post on how to override Laravel's default translation provider.
When building a website for a client that wants to be able to manage content, Laravel's language files aren't ideal since you can't edit them without diving into a bundle of text files. We recently decided to drop all the lang files in our custom CMS in favor of persisting translations in the database, which allows us to build a custom interface for managing them.This post is a quick overview on overwriting Laravel's default translation loader, which means you can keep using the lang method while fetching the translations from a database. Writing a custom loader is easier than it sounds. First we'll set up our translation models, then we'll write our loader, and finally register it in our application.
https://sebastiandedeyne.com/posts/2016/using-a-database-for-localization-in-laravel
Seb implemented the described functionality in Blender, our Laravel template we use to kickstart nearly all our projects.
Some great coding tips written down by Joeri Timmermans on the Intracto blog.
As a developer it's your duty to take good care of your code. It's not enough for your code to work, you also have to make sure it's well written and readable. If we spend 10 times more time reading code versus actually writing it, this means the readability of your code is directly related to your output and the output of your co-workers. So providing cheaper reads will not only create happier co-workers, but also increase the productivity of your whole team.
http://blog.intracto.com/how-to-save-a-kitten-by-writing-clean-code
Frank de Jonge wrote an article on how to structure to your functions to avoid the duplication of cleanup code. Spoiler: use finally
.
Cleaning up after yourself can be a tedious task. For example, closing file handlers after using them needs to be done. A programmer's life isn't all about the happy path. When things go pear-shaped you might end up duplicating cleanup code throughout your code. This is horrible, let's explore an alternative.
https://blog.frankdejonge.nl/finally-file-streams-and-deferred-execution-in-php/
That defer
keyword from Go looks super nice.
A few days ago I blogged some code to fetch data from Packagist using our homebrew wrapper around the packagist API. To summarize the amount of downloads this code was used: $totals = collect($packagist->getPackagesByVendor('spatie')['packageNames']) ->map(function…