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 | |
$isCreate = $this->formGetContext() == 'create'; | |
$pageUrl = isset($pageUrl) ? $pageUrl : null; | |
?> | |
<div class="form-buttons loading-indicator-container"> | |
<!-- Save --> | |
<a | |
href="javascript:;" | |
class="btn btn-primary oc-icon-check save" |
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 namespace Author\PluginName; | |
use System\Classes\PluginBase; | |
use Backend\Facades\BackendMenu; | |
class Plugin extends PluginBase | |
{ | |
public function register() { | |
BackendMenu::registerContextSidenavPartial('Author.PluginName', | |
'sidebar-menu', |
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
Lưu ý: Odoo chỉ kết nối với PostgreSQL, nên phải cài đặt PostgreSQL trước. | |
Bước 1: Cài các chương trình cần thiết theo dòng lệnh bên dưới | |
> sudo apt install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less | |
# nếu python 2 thì chạy lệnh dưới | |
> sudo apt-get install python-dateutil python-docutils python-feedparser python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi poppler-utils python-pip python-pypdf python-passlib python-decorator gcc python-dev mc bzr python-setuptools python-markupsafe python-reportlab-accel python-zsi python-yaml python-argparse python-openssl python-egenix-mxdatetime python-usb python-serial lptools |
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
Run this | |
"sudo -u postgres psql" | |
in your terminal to get into postgres | |
postgres=# | |
Run "CREATE USER new_username;" | |
Note: Replace new_username with the user you want to create, |
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
sudo update-alternatives --config php | |
sudo service nginx restart | |
sudo service php7.2-fpm restart |
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
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'some_pass'; | |
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION; | |
FLUSH PRIVILEGES; | |
## remote connection - not secure | |
CREATE USER 'admin'@'%' IDENTIFIED BY 'some_pass'; | |
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION; | |
FLUSH PRIVILEGES; |
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
# export postgres db | |
pg_dump -p [post] -U [username] -h [host] -d [db_name] > dbexport.pgsql | |
# import postgres db | |
psql -p [post] -U [username] -h localhost [dbname] < dbexport.pgsql |
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 | |
/** | |
* Convert datetime in db into local datetime | |
* @param string $datetime | |
* @param string $format | |
* @param string $timezone | |
* @return String | |
*/ | |
public static function convert_datetime_to_local($datetime, $format = 'H:i d-m-Y', $timezone = 'Asia/Ho_Chi_Minh') | |
{ |
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
server { | |
listen 80; | |
server_name .example.co.uk.dev; | |
access_log /usr/local/var/log/nginx/example.co.uk-access.log; | |
error_log /usr/local/var/log/nginx/example.co.uk-error.log error; | |
root /var/www/example.co.uk/public; | |
index index.php index.html; |
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 | |
/** | |
* QR Code + Logo Generator | |
* | |
* http://labs.nticompassinc.com | |
*/ | |
$data = isset($_GET['data']) ? $_GET['data'] : 'https://tunlookup.com/'; | |
$size = isset($_GET['size']) ? $_GET['size'] : '200x200'; | |
$logo = isset($_GET['logo']) ? $_GET['logo'] : FALSE; | |
header('Content-type: image/png'); |