Skip to content

Instantly share code, notes, and snippets.

View phannaly's full-sized avatar
🎴
Trekking

phanna phannaly

🎴
Trekking
View GitHub Profile
@phannaly
phannaly / composer.json
Created August 5, 2017 03:13 — forked from mfurlend/composer.json
composer require git repository
{
"name": "my_vendor_name/my_package",
"description": "My Package Description",
"license": "GPL-3.0",
"autoload": {
"classmap": [ // search these directories for classes
"lib/"
]
},
"repositories": {

Laravel increase performance for production

php artisan route:cache
php artisan optimize --force

composer dumpautoload --optimize
composer dumpautoload --classmap-authoritative
@phannaly
phannaly / insall_nodejs_prod.sh
Created August 1, 2017 06:05
Install NodeJS in production server
# Install Nodejs
sudo apt-get update
sudo apt-get install git
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install nodejs
# Install PM2
sudo apt-get install -g pm2
@phannaly
phannaly / flightplan-deploy.md
Created August 1, 2017 04:16 — forked from learncodeacademy/flightplan-deploy.md
Deploy Node.js Apps with Flightplan

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
@phannaly
phannaly / sqlsrv_php7.sh
Created July 26, 2017 03:09
Install sql server driver for ubuntu
# Install this module to get phpsize
sudo apt-get install php7.0-dev
# Install php7.0-sybase contains the pdo_dblib module.
sudo apt install php7.0-sybase
# Switch to root and add to packages
sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
@phannaly
phannaly / child-theme-functions.php
Created May 18, 2017 08:47 — forked from lots0logs/child-theme-functions.php
WordPress :: Divi Builder :: Search Module :: Custom Post Types
<?php
function my_remove_default_et_pb_custom_search() {
remove_action( 'pre_get_posts', 'et_pb_custom_search' );
add_action( 'pre_get_posts', 'my_et_pb_custom_search' );
}
add_action( 'wp_loaded', 'my_remove_default_et_pb_custom_search' );
function my_et_pb_custom_search( $query = false ) {
if ( is_admin() || ! is_a( $query, 'WP_Query' ) || ! $query->is_search ) {