Skip to content

Instantly share code, notes, and snippets.

View hoannc54's full-sized avatar

Nguyễn Công Hoan hoannc54

  • Hanoi
View GitHub Profile
@hoannc54
hoannc54 / AbstractFoo.php
Created April 18, 2018 21:25 — forked from pjdietz/cloudSettings
Testing Protected Method of Abstract Class with PHPUnit
<?php
namespace Minitest;
abstract class AbstractFoo
{
protected function bar()
{
return $this->baz();
}

Source

Compound (Composite) Indexes - MariaDB Knowledge Base

A mini-lesson in "compound indexes" ("composite indexes")

This document starts out trivial and perhaps boring, but builds up to more interesting information, perhaps things you did not realize about how MariaDB and MySQL indexing works.

This also explains [EXPLAIN][1] (to some extent).

Source

Chỉ mục hỗn hợp - kiến thức cơ sở MariaDB

Một bhọc bài học nhỏ trong "Chỉ mục hỗn hợp"

Tài lnày tài liệu này tầm thường và có lẽ là nhàm chán, nhưng lại tạo nên nhiều thông tin thú vị, có lẽ điều mà bạn không nhận ra về cách hoạt động đánh chỉ mục của MariaDB và MySQL.

Điều này cũng giải thích [EXPLAIN][1] (đến một mức độ nào đó).

@hoannc54
hoannc54 / migrate.sh
Created May 11, 2018 02:50 — forked from pepijnblom/migrate.sh
Upgrade MAMP to Mysql 5.7
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.15-osx10.11-x86_64.tar.gz
tar xfvz mysql-5.7*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"
@hoannc54
hoannc54 / migrate.sh
Created May 28, 2018 09:27 — forked from pedro-santiago/migrate.sh
Upgrade MAMP 4 to Mysql 5.7.18 (on Sierra tested)
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-macos10.12-x86_64.tar.gz
tar xfvz mysql-5.7.18-macos10.12-x86_64.tar.gz
echo "Stopping MAMP"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "Copy Bin"
@hoannc54
hoannc54 / apps.yml
Last active July 27, 2018 15:38 — forked from vuthaihoc/apps.yml
Build ffmpeg 4 with fdk-aac x264 x265 xvid lame on centos 6
apps:
- script : /path/to/artisan
name : 'converter'
interpreter : /path/to/php
cwd : /path/to/code
exec_mode: fork
args : args1 args2
autorestart : true
restart_delay : 30000
out_file : /path/to/log/converter.out.log
@hoannc54
hoannc54 / latest-ffmpeg-centos7.sh
Last active November 22, 2018 23:43 — forked from bodny/latest-ffmpeg-centos7.sh
Installs latest ffmpeg on Centos 7
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum -y install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
<?php
<<<CONFIG
packages:
- "symfony/process:^5.0"
CONFIG;
/**
* Created by PhpStorm.
* User: hocvt
* Date: 2020-04-03
@hoannc54
hoannc54 / create_mysql5_db.sh
Created June 17, 2020 07:07 — forked from vuthaihoc/create_mysql5_db.sh
Script create db, user and grant permission
#!/bin/bash
# sudo ./mysql-db-create.sh dbname dbuser password
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
EXPECTED_ARGS=3
E_BADARGS=65
MYSQL=`which mysql`
@hoannc54
hoannc54 / system_usage_log.sh
Created June 17, 2020 07:07 — forked from vuthaihoc/system_usage_log.sh
System usage bash
#!/bin/bash
## Use : ss command
## variable for change :
##
##----------
Timetemp='%H%M'
Time=$(date +"${Timetemp}")
Date=$(date +"%y%m%d")
Yest=$(date --date="1 day ago" +"%y%m%d")
#Day=$(date +"%a")