Skip to content

Instantly share code, notes, and snippets.

View tranquangchau's full-sized avatar

Trần Quang Châu tranquangchau

View GitHub Profile
Đến folder C:\xampp\mysql\bin
Mở file my.ini
Thêm skip-grant-tables phía dưới thẻ [mysqld]
Vào windows services và stop mysql
Vào CMD cd C:\xampp\mysql\bin\mysql
@tranquangchau
tranquangchau / bootstrap.min.css
Created April 22, 2018 19:05
Evoluted Directory Listing Script _Update Chau
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:
@tranquangchau
tranquangchau / index.php
Last active April 22, 2018 17:15
php SEO for url variable, utf8 character for url and file
<?php
private function utf8convert($str) {
if(!$str) return false;
$ext = substr($str,strrpos($str,'.',-1),strlen($str));
$str = substr($str,0,strrpos($str,'.',-1));
$utf8 = array(
'a'=>'á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ|Á|À|Ả|Ã|Ạ|Ă|Ắ|Ặ|Ằ|Ẳ|Ẵ|Â|Ấ|Ầ|Ẩ|Ẫ|Ậ',
@tranquangchau
tranquangchau / index.php
Last active April 17, 2018 05:10
fetch get and post of javascript
<?php
var_dump($_POST);die;
<?php
$url_upload = 'http://localhost/server/php/';
}
$filePath = "test.jpg";
$info_file = pathinfo($filePath);
$list_file_upload = ['jpeg','gif','jpg','png'];
$file_type = strtolower($info_file['extension']);
<div class="drop">
<div>
<img src="https://marketplace.canva.com/MAB0hy3YH9s/1/thumbnail/canva-arrow-MAB0hy3YH9s.png"/>
</div>
</div>
@tranquangchau
tranquangchau / gist:be42691ed017bf23a5781c4d4b424679
Created March 9, 2018 00:55 — forked from timonweb/gist:3165322
Code to catch all PHP errors which result in 500 Error Code. Include this snippet at the beginning of index.php file
<?php
define('E_FATAL', E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR |
E_COMPILE_ERROR | E_RECOVERABLE_ERROR);
define('ENV', 'dev');
//Custom error handling vars
define('DISPLAY_ERRORS', TRUE);
define('ERROR_REPORTING', E_ALL | E_STRICT);
@tranquangchau
tranquangchau / exe.php
Last active May 23, 2017 23:15
var dum query
<?php
$posts_per_page = 10;
$args = array('post_type' => 'product',
'posts_per_page' => $posts_per_page,
'paged' => $paged,
'post_status' => 'publish',
//'orderby' => 'post_date',
'orderby' => 'post_content_filtered',
// 'order' => 'ASC',
'order' => 'DESC',
@tranquangchau
tranquangchau / gist:67ef9f90b9c1b238f051991a102c8a69
Created May 12, 2017 18:42
woocommerce get price without currency
global $woocommerce;
$currency = get_woocommerce_currency_symbol();
$info['price'] = number_format( $price, wc_get_price_decimals(), wc_get_price_decimal_separator(), wc_get_price_thousand_separator()).$currency;
//WC Version: 2.6.11
//WP Version: 4.7.1
<!--<script type="text/javascript" src="https://select2.github.io/vendor/js/jquery.min.js"></script>-->
<script type="text/javascript" src="https://select2.github.io/dist/js/select2.full.js"></script>
<!--<link href="https://select2.github.io/css/bootstrap.css" type="text/css" rel="stylesheet" />-->
<link href="https://select2.github.io/dist/css/select2.min.css" type="text/css" rel="stylesheet" />
<select multiple id="e1" style="width:300px">
<option value="AL">Alabama</option>
<option value="Am">Amalapuram</option>