Skip to content

Instantly share code, notes, and snippets.

View trungpv1601's full-sized avatar
🤖
Diversifying; Practical; more code than talk.

trungpv trungpv1601

🤖
Diversifying; Practical; more code than talk.
View GitHub Profile
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
// == Enforcing Options ===============================================
//
// These options tell JSHint to be more strict towards your code. Use
// them if you want to allow only a safe subset of JavaScript, very
let NETWORK_PRESETS = {
'GPRS': {
'offline': false,
'downloadThroughput': 50 * 1024 / 8,
'uploadThroughput': 20 * 1024 / 8,
'latency': 500
},
'Regular2G': {
'offline': false,
'downloadThroughput': 250 * 1024 / 8,
@trungpv1601
trungpv1601 / puppeteer.sh
Last active April 16, 2019 14:58
puppeteer.sh
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install nodejs -y
sudo apt-get install npm -y
# Fix Trouble Puppeteer
sudo apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libnss3-dev
@trungpv1601
trungpv1601 / lamp-setup.sh
Last active March 20, 2019 07:53
lamp-setup.sh
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade
sudo apt install apache2 -y
sudo apt install mysql-server -y
sudo mysql_secure_installation
@trungpv1601
trungpv1601 / my.cnf
Created March 23, 2019 09:36 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# === Updated December 2018 ===
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
<?php
namespace Deployer;
$startTime = microtime(true);
require 'recipe/common.php';
// Project name
set('application', 'xxx');
@trungpv1601
trungpv1601 / Magento 2 ownership and permissions.MD
Last active April 3, 2019 08:00
Magento 2 ownership and permissions
cd <your Magento install dir> 
find . -type f -exec chmod 644 {} \;                        // 644 permission for files
find . -type d -exec chmod 755 {} \;                        // 755 permission for directory 
find ./var -type d -exec chmod 777 {} \;                // 777 permission for var folder    
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chown -R :<web server group> .
@trungpv1601
trungpv1601 / Magento 2 Install Step by Step.MD
Last active April 3, 2019 08:00
Magento 2 Install Step by Step
@trungpv1601
trungpv1601 / composer.json
Created April 13, 2019 04:54
PHP Composer package locally
{
"name": "trungpv/application",
...
"repositories": {
"dev-package": {
"type": "path",
"url": "relative/or/absolute/path/to/my/dev-package",
"options": {