- Make sure mysql-client is installed. If not, then :
sudo apt install mysql-client
or
sudo apt-get install mysql-client
- Open php.ini
; PHP's default character set is set to UTF-8.
"""Task locking with redis in celery is hard, and good examples are tough to come by. This is the approach that's | |
worked for me, based on great work that other folks have posted: | |
* https://breadcrumbscollector.tech/what-is-celery-beat-and-how-to-use-it-part-2-patterns-and-caveats/ | |
* http://loose-bits.com/2010/10/distributed-task-locking-in-celery.html | |
* https://redis.io/topics/distlock | |
This isn't polished,but hopefully it's useful. To verify it in our local test env we register the following test task in | |
our definitions file: | |
*** definitions.py *** |
sudo apt install mysql-client
or
sudo apt-get install mysql-client
; PHP's default character set is set to UTF-8.
I had my api ready and faced the problem of converting them into rest routes with api and version prefixs using the cakephp Router::mapResources function that was provided by default by CakePhp,
My api was intially,
http://www.xyz.com/controller/
supporting basic rest routes and I wanted it to be in the form
http://www.xyz.com/api/version_number/controller/action
that would support basic rest routes with prefix including api and version number.
To achieve this there are two ways:
#Laravel 5 Simple ACL manager
Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.
If the user has a 'Root' role, then they can perform any actions.
Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php
Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.
For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.
But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.
SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil
This tutorial describes how to set PHP_CodeSniffer as the local project dependency instead of the suggested global PEAR dependency.
Follow the https://github.com/squizlabs/PHP_CodeSniffer/blob/master/README.markdown
Add the following configuration to your composer.json
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
First and foremost, let's take a look at the following pieces of code. The first one is something you should be rather familiar with, and the second one is also a somewhat familiar idiom these days (at least in languages with higher-order functions):
// Example 1:
30 + 12
// Example 2:
xs.map(f)
<?php | |
class AppModel extends Model { | |
function afterFind($results){ | |
if(!isset($results[0])){ | |
// $results is a single object. | |
$results = $this->realAfterFind($results); |