Skip to content

Instantly share code, notes, and snippets.

View HoangPV's full-sized avatar

Hoang Phan HoangPV

  • Ho Chi Minh City, Vietnam
View GitHub Profile
@HoangPV
HoangPV / password_hash_example.php
Created November 2, 2017 02:52 — forked from jeremykendall/password_hash_example.php
Example of password hashing and verification with password_hash and password_verify. This script is intended to be run from the command line like so: 'php -f password_hash_example.php'
<?php
/**
* Example of password hashing and verification with password_hash and
* password_verify
*
* This script is intended to be run from the command line
* like so: 'php -f password_hash_example.php'
*
* @see http://stackoverflow.com/a/20809916/1134565
@HoangPV
HoangPV / Ciphers.php
Created November 7, 2017 03:57 — forked from hinchley/Ciphers.php
Caesar Cipher and Vigenère Cipher in PHP
<?php
class Map {
/* $table = [
* 'encrypt' =>
* ['A' => 'A', 'B' => 'B', ...],
* ['A' => 'B', 'B' => 'C', ...],
* ...
* 'decrypt' =>
* ['A' => 'A', 'B' => 'B', ...],
@HoangPV
HoangPV / install-docker.md
Created July 8, 2021 03:48 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@HoangPV
HoangPV / gist:560075ae6254c2348f98f798ea76c1cb
Created July 14, 2021 15:32 — forked from thachpham92/gist:d57b18cf02e3550acdb5
Tất cả các tham số trong WP_Query
// Source: https://gist.github.com/luetkemj/2023628
// Xem hướng dẫn WP_Query toàn tập: http://goo.gl/kRpzTz
<?php
$args = array(
//////Author Parameters - Tham số lấy bài viết theo tác giả
//http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
'author' => '1,2,3,', //(int) - Các ID tác giả cần lấy bài viết (thêm dấu - vào để loại trừ tác giả, ví dụ: -14, -20)
'author_name' => 'luetkemj', //(string) - Lấy bài viết dựa theo tên nick name của tác giả
'author__in' => array( 2, 6 ), //(array) - Lấy bài dựa theo ID của tác giả
@HoangPV
HoangPV / xdebug-mac.md
Created August 22, 2021 17:12 — forked from ankurk91/xdebug-mac.md
php xDebug v3 on Ubuntu/Mac and phpStorm

🪲 Install and Configure xDebug v3 on MacOS for PhpStorm 🐘

  • Assuming that you have already installed php and apache via Homebrew

  • Install xDebug php extension

pecl channel-update pecl.php.net
pecl clear-cache

pecl install xdebug
@HoangPV
HoangPV / gist:e5e176903059825a331eb371c7901f41
Created August 22, 2021 17:15 — forked from fabriceleal/gist:6163707
Xdebug stuff (debugging) on php.ini
;; if you're using zend server, you may need to
;; 1 - remove/disable etc/conf.d/debugger.ini
;; 2 - comment zend.ini_scandir=... altogether
;;
;; I've had success with both :|
;; on zend server, install xdebug via pecl
;; or if you feel brave, checkout the source
;; and build it yourself (check the README,
;; watch out for the necessary configurations before make)