-
Get Python Wheel pgAdmin4
wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v2.0/pip/pgadmin4-2.0-py2.py3-none-any.whl
-
Install pip3
sudo apt install python3-pip
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle
The API we are creating in this gist will follow these rules :
- The API only returns JSON responses
- All API routes require authenticationu
- Authentication is handled via OAuth2 with
password
Grant Type only (no need for Authorization pages and such). - API versioning is managed via a subdomain (e.g.
v1.api.example.com
)
The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
'components' => [ | |
'db' => [ | |
'class' => '\yii\db\Connection', | |
'dsn' => 'mysql:host=127.0.0.1;dbname=demo', | |
'username' => 'root', | |
'password' => '', | |
'charset' => 'utf8', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install dependencies | |
# older ubuntus | |
#apt-get install build-essential libsqlite3-dev ruby1.9.1-dev | |
# xenial | |
apt install build-essential libsqlite3-dev ruby-dev | |
# Install the gem | |
gem install mailcatcher --no-ri --no-rdoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use OpenCloud\OpenStack; | |
use League\Flysystem\Filesystem; | |
use League\Flysystem\Rackspace\RackspaceAdapter; | |
$client = new OpenStack('https://auth.selcdn.ru', [ | |
'username' => '...', | |
'password' => '...' | |
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PHANTOM_JS="phantomjs-1.9.8-linux-x86_64" | |
if [[ $EUID -ne 0 ]]; then | |
echo "You must be a root user" 2>&1 | |
exit 1 | |
else | |
apt-get update | |
apt-get install -y build-essential chrpath libssl-dev libxft-dev | |
apt-get install -y libfreetype6 libfreetype6-dev | |
apt-get install -y libfontconfig1 libfontconfig1-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env php | |
<?php | |
require_once 'vendor/autoload.php'; | |
use Symfony\Component\Console\Application; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\Console\Input\InputArgument; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php app/console doctrine:mapping:convert --namespace="MySuper\DuperBundle\Entity\MyEntity" yaml src/MySuper/DuperBundle/Resources/config/doctrine | |
That command will convert the annotation file into yaml format into src/MySuper/DuperBundle/Resources/config/doctrine as MySuper.DuperBundle.Entity.MyEntity.orm.yml |
NewerOlder