Skip to content

Instantly share code, notes, and snippets.

View hieuhuynh93's full-sized avatar
💭
I may be slow to respond.

Hieu Huynh hieuhuynh93

💭
I may be slow to respond.
View GitHub Profile
@hieuhuynh93
hieuhuynh93 / get_password
Created May 6, 2025 14:11 — forked from landbryo/get_password
Retrieves password for requested email account in Plesk Linux.
Plesk email users often get their passwords lost.
Fortunately Parallels has implemented a command to see all passwords for all users in all domains:
`/usr/local/psa/admin/bin/mail_auth_view`
You can filter the output to see one account password (quotes must exist):
`/usr/local/psa/admin/bin/mail_auth_view | grep "johnsmith@domain.tld"`
@hieuhuynh93
hieuhuynh93 / toURLFriendly.php
Created March 13, 2021 14:37 — forked from xbill82/toURLFriendly.php
PHP: String to URL friendly
<?
/**
* @param String $str The input string
* @return String The string without accents
*/
function removeAccents( $str )
{
$a = array('À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð',
'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'ß', 'à', 'á', 'â', 'ã',
'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ',
@hieuhuynh93
hieuhuynh93 / Install Composer using MAMP's PHP.md
Created September 14, 2020 06:31 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@hieuhuynh93
hieuhuynh93 / infinite-previous-next-looping.php
Created September 7, 2020 06:39 — forked from banago/infinite-previous-next-looping.php
Infinite next and previous post looping in WordPress
<?php
/**
* Infinite next and previous post looping in WordPress
*/
if( get_adjacent_post(false, '', true) ) {
previous_post_link('%link', '&larr; Previous Post');
} else {
$first = new WP_Query('posts_per_page=1&order=DESC'); $first->the_post();
echo '<a href="' . get_permalink() . '">&larr; Previous Post</a>';
wp_reset_query();
@hieuhuynh93
hieuhuynh93 / facebook_warning.html
Created August 25, 2020 17:17 — forked from tosbourn/facebook_warning.html
How to recreate Facebook's console warning
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
const warningTitleCSS = 'color:red; font-size:60px; font-weight: bold; -webkit-text-stroke: 1px black;';
const warningDescCSS = 'font-size: 18px;';
@hieuhuynh93
hieuhuynh93 / Common-Currency.json
Created January 20, 2020 04:28 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@hieuhuynh93
hieuhuynh93 / VnMobilePhoneRegEx.md
Created December 28, 2019 10:38 — forked from thienhoang157/VnMobilePhoneRegEx.md
Vietnamese Mobile Phone Regex Test

Vietnamese Mobile Phone Regex Test

JavaScript

var regEx = /^0(1\d{9}|9\d{8})$/;
var phone = '0912345678';
var match = regEx.test(phone);
@hieuhuynh93
hieuhuynh93 / media-query.css
Created July 25, 2019 07:48 — 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
@hieuhuynh93
hieuhuynh93 / class.envato2.php
Created May 30, 2019 10:23 — forked from dtbaker/class.envato2.php
Using the verify-purchase endpoint of the new Envato API to validate a purchase code.
<?php
// NOTE: verify-purchase has been deprecated and it's best to use the new /author/sale endpoint as documented on http://build.envato.com/
// created by Envato user wpdreams https://forums.envato.com/t/verify-purchase-class/3526
// usage example:
$o = EnvatoApi2::verifyPurchase( $purchase_code );
@hieuhuynh93
hieuhuynh93 / function.php
Created May 23, 2019 06:40 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
// Add to existing function.php file
// Disable support for comments and trackbacks in post types
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');