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
@trungpv1601
trungpv1601 / gist:b9936bb455f034d10bfc2bdecfabcae9
Created December 1, 2017 04:31 — forked from Mikodes/gist:be9b9ce42e46c3d4ccb6
All Media queries for resolutions
/* (320x480) iPhone (Original, 3G, 3GS) */
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
/* insert styles here */
}
/* (320x480) Smartphone, Portrait */
@media only screen and (device-width: 320px) and (orientation: portrait) {
/* insert styles here */
}
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
@trungpv1601
trungpv1601 / gist:42ff51178c9ab62fa3382dc6b8112d11
Created January 30, 2018 12:08
Deploy Laravel Ubuntu Envoy
https://serversforhackers.com/c/creating-users-and-ssh-security
https://serversforhackers.com/c/deploying-with-envoy-cast
@trungpv1601
trungpv1601 / README.MD
Created February 4, 2018 02:24
Using Genymotion With Charles Proxy

In your Genymotion Android emulator…

  • Settings -> Wifi -> Press and hold your active network
  • Select “Modify Network”
  • Select “Show Advanced Options”
  • Select “Proxy Settings -> Manual”
  • Set your Proxy to: 10.0.3.2 (Genymotion’s special code for the local workstation)
  • Set your Port to: 8888
  • Press Save

You should now be able to see Genymotion traffic showing up in your Charles Proxy

@trungpv1601
trungpv1601 / docker-command.md
Last active May 7, 2018 05:50
Docker command

MYSQL

docker run --name mysql -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 --restart=always -d mysql --default-authentication-plugin=mysql_native_password

PHPMYADMIN

  • mysql <= Name contatiner mysql
@trungpv1601
trungpv1601 / index.js
Created May 7, 2018 07:45
Async Map in Javascript
const arr = [ { key: 1 }, { key: 2 }, { key: 3 } ]
const result = arr.map(async (obj) => { return obj.key; });
console.log(`Result: ${result}`);
// outputs "Result: ???"
@trungpv1601
trungpv1601 / README.MD
Last active February 16, 2019 08:16
Docker Command

Redis

docker run --name my-redis -p 6379:6379 --restart always --detach redis --requirepass <password>

Selenium

docker run -d --name selenium-hub -p 4444:4444 --restart always selenium/hub
function getBaseUrl($includeTrailingSlash = FALSE)
{
$protocol = (isset($_SERVER['HTTPS']) && 'off' !== $_SERVER['HTTPS']) ? 'https' : 'http';
$domain = php_uname('n');
$port = '';
if (isset($_SERVER['HTTP_HOST'])) {
$domain = filter_input(
INPUT_SERVER,
'HTTP_HOST',
@trungpv1601
trungpv1601 / Fix Puppeteer on Ubuntu.md
Created March 13, 2019 07:43
Chrome Headless doesn't launch on Debian
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
const browser = await puppeteer.launch({args: ['--no-sandbox']});
@trungpv1601
trungpv1601 / INSTALL.MD
Created March 14, 2019 05:27
Template Nodejs Web Application
npm install --save consolidate cookie-parser csurf debug dotenv finalhandler helmet mustache router shortid xtend