Skip to content

Instantly share code, notes, and snippets.

/* Hide WP version strings from scripts and styles
* @return {string} $src
* @filter script_loader_src
* @filter style_loader_src
*/
function remove_wp_version_strings( $src ) {
global $wp_version;
parse_str(parse_url($src, PHP_URL_QUERY), $query);
if ( !empty($query['ver']) && $query['ver'] === $wp_version ) {
$src = remove_query_arg('ver', $src);
@salipro4ever
salipro4ever / password_regex.md
Created September 30, 2021 07:53 — forked from frizbee/password_regex.md
Regex for password must contain

Minimum eight characters, at least one letter and one number:

/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/

Minimum eight characters, at least one letter, one number and one special character:

/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$/

Minimum eight characters, at least one uppercase letter, one lowercase letter and one number:

const HOST_URL = process.env.BASE_URL || 'http://localhost:3000';
//const API_URL = process.env.BASE_API_URL || 'http://14.225.11.12:3030/api/client';
const API_URL = process.env.BASE_API_URL || 'http://localhost:3000';
const webpack = require("webpack");
module.exports = {
mode: 'spa',
@salipro4ever
salipro4ever / nuxt.config.js
Created September 26, 2021 16:50 — forked from mjgartendev/nuxt.config.js
An example nuxt.config.js file heavily commented from the nuxt and vue-meta documentation examples
module.exports = {
/*
Headers of the page
- Nuxt.js uses vue-meta to update the headers and html attributes of your application.
- Nuxt.js configures vue-meta with these options:
{
keyName: 'head', // the component option name that vue-meta looks for meta info on.
attribute: 'data-n-head', // the attribute name vue-meta adds to the tags it observes
ssrAttribute: 'data-n-head-ssr', // the attribute name that lets vue-meta know that meta info has already been server-rendered
tagIDKeyName: 'hid' // the property name that vue-meta uses to determine whether to overwrite or append a tag
@salipro4ever
salipro4ever / jquery-scroll-bottom.js
Created September 16, 2021 18:23 — forked from toshimaru/jquery-scroll-bottom.js
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
/*
Before Septemper 15 2018, Vietnam has phone number start with 09*, 01(2|6|8|9).
After that, the phone number can start with 03, 05, 07 or 08.
So this function provide a way to validate the input number is a Vietnamese phone number
*/
function isVietnamesePhoneNumber(number) {
return /(03|05|07|08|09|01[2|6|8|9])+([0-9]{8})\b/.test(number);
}
@salipro4ever
salipro4ever / paginate.php
Created December 8, 2018 17:10 — forked from ctf0/paginate.php
Laravel Paginate Collection or Array
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
*
* @return LengthAwarePaginator
*/
@salipro4ever
salipro4ever / meta-tags.md
Created June 11, 2018 04:31 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@salipro4ever
salipro4ever / bootstrap.php
Created February 23, 2017 04:02 — forked from vitalyrotari/bootstrap.php
Language support for FuelPHP
/**
* app/bootstrap.php
*/
Autoloader::add_classes(array(
// Add classes you want to override here
// Example: 'View' => APPPATH.'classes/view.php',
'Uri' => APPPATH.'classes/uri.php',
'LayoutHelper' => APPPATH.'classes/layouthelper.php',
));
@salipro4ever
salipro4ever / gist:064870654b9d7b4fc63fd21d09c9e40f
Created August 23, 2016 16:16 — 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ả