Skip to content

Instantly share code, notes, and snippets.

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

Pham Quang quangpd

💭
I may be slow to respond.
View GitHub Profile
TAB CLOSEALLOTHERS
SET !LOOP -9999999
SET !EXTRACT_TEST_POPUP NO
SET !TIMEOUT_PAGE 10
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0.5
URL GOTO=http://addmefast.com/free_points/facebook_likes
TAG POS=1 TYPE=DIV ATTR=TXT:Like
TAB T=2
<?php
/**
*
*/
class ToHop
{
public $a = array();
public $n;
public $k;
1. Độ mạnh của mật khẩu
^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8}$
Kiểm tra độ mạnh của một mật khẩu thường là chủ quan nên không có câu trả lời chính xác tuyệt đối. Nhưng tôi cảm thấy đoạn regex này là một điểm khởi đầu tuyệt vời nếu bạn không muốn phải viết riêng hàm kiểm tra độ mạnh mật khẩu của bạn từ đầu.
2. Mã màu Hex
\#([a-fA-F]|[0-9]){3, 6}
Mã màu hex rất phố biến trong lĩnh vực phát triển web. Đoạn regex này có thể được sử dụng để lấy mã hex phù hợp từ chuỗi bất kỳ cho bất cứ mục đích nào.
/* Tính tuổi */
function calculateAge (birthDate, otherDate) {
birthDate = new Date(birthDate);
otherDate = new Date(otherDate);
var years = (otherDate.getFullYear() - birthDate.getFullYear());
if (otherDate.getMonth() < birthDate.getMonth() || otherDate.getMonth() == birthDate.getMonth() && otherDate.getDate() < birthDate.getDate()) {
years--;
}
return years;
}
<?php
/*
* Danh sach tat ca controller va method trong HMVC CodeIgniter
* modules/*
* application/controllers/*
*/
function structure()
{
$hmvc = array();
foreach(glob(APPPATH . 'controllers/*') as $controller)