Skip to content

Instantly share code, notes, and snippets.

View kungfu321's full-sized avatar
🎯
Focusing

Vo Manh Kien kungfu321

🎯
Focusing
View GitHub Profile
@kungfu321
kungfu321 / remove-all-from-docker.sh
Last active July 16, 2021 17:20 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
#remove all unused data
docker system prune
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images

A simple Docker and Docker Compose install script for Ubuntu

Usage

  1. sh install-docker.sh
  2. log out
  3. log back in

Links

@kungfu321
kungfu321 / gist:2df2c2ab8bd1b2876d415d621e7e9eee
Created September 26, 2020 06:13 — 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ả
@kungfu321
kungfu321 / error_msg.php
Created July 22, 2020 02:19 — forked from sudar/error_msg.php
Creating single select WordPress taxonomies. Explanation at http://sudarmuthu.com/blog/creating-single-select-wordpress-taxonomies/
<?php
/**
* Display an error message at the top of the post edit screen explaining that ratings is required.
*
* Doing this prevents users from getting confused when their new posts aren't published, as we
* require a valid rating custom taxonomy.
*
* @param WP_Post The current post object.
*/
function show_required_field_error_msg( $post ) {
@kungfu321
kungfu321 / countries.json
Created July 27, 2019 03:56 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},