Skip to content

Instantly share code, notes, and snippets.

View hehe24h's full-sized avatar

Ròm Tiến Đạt hehe24h

View GitHub Profile
@hehe24h
hehe24h / redirect.php
Created April 4, 2019 05:50
PHP chuyển trang Redirect
<?php
function devCheckInput($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
if (!empty($_SERVER['QUERY_STRING'])) {
$queryString = "?" . devCheckInput($_SERVER['QUERY_STRING']);
@hehe24h
hehe24h / Ping sitemaps.js
Created March 23, 2019 11:23
Ping sitemaps.js
function sc_cron() {
var cron_files = [ 'index.php', 'script-1.php', 'script-2.php', 'neu-can-thi-them.php' ];
var cron_dir = 'http://web-dat-script.net/thu-muc-chua-script/';
for ( var i = 0; i < cron_files.length; i++ ) {
scCURL( cron_dir + cron_files[ i ] );
}
}
function scCURL( url ) {
@hehe24h
hehe24h / GROUP BY.sql
Last active February 28, 2019 20:38
GROUP BY
SELECT `mcm_device`, COUNT(*) FROM `wp_mcm` GROUP BY `mcm_device`
SELECT `duplicates`, COUNT(*) AS duplicate_value FROM `wp_mcm` GROUP BY `duplicates` ORDER BY `duplicate_value` DESC
@hehe24h
hehe24h / media-query.css
Created January 2, 2019 04:56 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
*/30 * * * * wget -O - https://mcm.azystore.com/cronjob/ >/dev/null 2>&1
(function () {
var param = 'fbclid';
if (location.search.indexOf(param + '=') !== -1) {
var replace = '';
try {
var url = new URL(location);
url.searchParams.delete(param);
replace = url.href;
} catch (ex) {
var regExp = new RegExp('[?&]' + param + '=.*$');
<script type="text/javascript">
$(document).ready(function() {
var timeout = 5; //Số giây muốn chuyển.
var tracking = "http://tiendatdev.com/"; //Link tracking, điền trong dấu "".
var count = timeout * 1000;
setTimeout(function() {
window.location.href = tracking;
@hehe24h
hehe24h / dat_ten_id_class.txt
Created November 20, 2018 11:10 — forked from buihuynhhung/dat_ten_id_class.txt
Một số cách đặt tên id và class
MỘT SỐ CÁCH ĐẶT TÊN ID VÀ CLASS
Cách đặt tên:
_ Tên không được quá dài. <= cực kỳ quan trọng.
_ Hạn chế dịch (Chỉ dịch khi chưa biết đó thuộc khu vực tên nào mà thôi).
_ Thường thì chỉ cần xác định rõ khu vực, ý muốn của designer là ta có thể đặt được tên cho phù hợp.
VD: nhìn vào biết khu vực mà design muốn đưa thông tin giới thiệu thì ta nên đặt các tên sau: introduce, info, information. Nếu giới thiệu về cty thì cần: aboutUs, company, …
_ Việc đặt tên này chẳng những có ý nghĩa cho từng khu vực, mà nó còn giúp cho người khác khi nhìn vào code sẽ dễ dàng hình dung đó là gì.
Common:
#header
nano /etc/nginx/nginx.conf
server_names_hash_bucket_size 128;
server_names_hash_bucket_size 256;
Ctrl +x rồi điền Y, Enter rồi khởi động lại nginx là được.
@hehe24h
hehe24h / LICENCE SUBLIME TEXT
Created September 10, 2018 16:19
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----