As it was a little less then trivial to get the current system time as string in Elixir, I’ve added this helper module that basically converts Erlang’s calendar output to a string that can be flexibly formatted: Continue reading
Category Archives: Programming
Deploying Elixir / Phoenix App Using Rolling Updates
As discussed in this post we gave rolling updates a shot after trying the releases, this kind of deployment is flexible and fast, so until we really need hot updates we’ll stay there.
There are few things to note though when deploying to production (our Server runs Ubuntu 16.04). Continue reading
Deploying Elixir Apps
Recently we started playing with Elixir which is an awesome language bringing quite a few perks in terms of performance, reliability and scalability but also enforcing a mentality shift to functional programming (as compared to OOP as in modern PHP).
When it came to deployment we basically had two options: using exrm releases or just starting the app (that uses Phoenix framework) in production mode.
Internet didn’t tell us much about which option is more useful aside from exrm being the “cooler” one and the rolling update – “easier”, so we tried both, starting with the cool one 🙂 Continue reading
PHPUnit – Integration Tests Console Output
When writing integration tests we have special group of slow tests that do a lot of stuff like performing hundreds of downloads or editing thousands of entries. In some cases one of the actions can trigger fatal error and the message would not be specific enough to determine which of those actions broke everything.
Here is a neat trick to enable any test to show console output, it uses fwrite to write to standard I/O stream: Continue reading
Mossack Fonseca Breach Theory
They were serving sensitive customer data from their portal website which includes a client login to access that data.
Here is an interesting theory on how the breach happened.
What is “real programming”?
Here is one disturbing read.
“Real programming”? Come on, sure webdev has its share of people who basically install and use content management systems and adjust appearance without implementing any functionality, but developing software that lives on server and can be used by client computers is as real as it gets.
Frameworks do the low level job for us these days, true. Just as C language does low level job so that programmers don’t have to use machine code. The idea of the lower level programming being more real then high level one is just silly and can do real damage as in above post.
Learn X in Y Minutes
tl;dr explanation on every possible topic, very useful!
Laravel – How To Fix Wrong Domain in Queue Jobs
There is a tricky problem that happens when queued job tries to get the URL (via URL helper or from config) – it doesn’t seem to “notice” the .env / config app.url setting.
The reason is that somehow the queue worker misses the current environment name (might only happen if it is managed system wide via upstart or similar service).
The solution would be to include the –env flag when running queue worker like that: Continue reading
Laravel Goodies
Here’s the list of packages that make Laravel development even easier.
Development
PHPUnit – require-dev or require in composer.json
"phpunit/phpunit": "~4.0"
and then run tests in cli directly from installed binary:
vendor/bin/phpunit
PHPSpec – require-dev or require in composer.json
"phpspec/phpspec": "~2.1"
and then similar to PHPUnit, run the tests using binary in vendor/bin
vendor/bin/phpspec desc App/Test
Profiling / debugging – laravel-debugbar
IDE auto-completion / PHPDoc – laravel-ide-helper
Faker – use to seed Database with realistic Data.
require-dev or require in composer.json
"fzaninotto/faker": "1.4.*@dev"
and then just get an instance
$faker = Faker\Factory::create();
and use it to fake just about anything.
Continue reading