Skip to content

Instantly share code, notes, and snippets.

@thanhluu
thanhluu / eleganttheme.html
Last active August 29, 2015 14:17
Elegant Theme Welcome Email
<body style="margin: 0">
<div marginwidth="0" marginheight="0" style="margin:0;padding:0;background-color:#e8e9e3">
<center>
<table style="border-collapse:collapse;margin:0;padding:0;background-color:#e8e9e3;height:100%!important;width:100%!important" height="100%" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td style="border-collapse:collapse" align="center" valign="top">
<table style="border-collapse:collapse;background-color:#e8e9e3;border-bottom:0" border="0" cellpadding="10" cellspacing="0" width="100%">
<tbody><tr>
<td style="border-collapse:collapse" align="center" valign="top">
@thanhluu
thanhluu / ifttt.html
Created March 13, 2015 06:54
Welcome to IFTTT
<div><div class="adM">
</div><p style="color:#333;font-family:'AvenirNext-Regular','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:24px;line-height:1.3;margin:20px auto 0;max-width:640px;padding:0;text-align:center;width:100%;margin-left:0;text-align:left;margin-top:0">
Hi thanhlt90,
</p>
<p style="color:#333;font-family:'AvenirNext-Regular','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:24px;line-height:1.3;margin:20px auto 0;max-width:640px;padding:0;text-align:center;width:100%;margin-left:0;text-align:left">
Welcome to IFTTT! Here are some Recipes to get you started:
</p>
<a href="#" style="display:inline" target="_blank">
<img alt="Receive an email when a NYT Technology article becomes popular" src="https://ci5.googleusercontent.com/proxy/blw1UDusQl3gDYuDdmZr9gqo6dLuK9BnxqTWJ7AsJPGtXc63T-QYi5qIfvDNOf3jFWv5LhF2zxS5Dk3NbH-V=s0-d-e1-ft#https://ifttt.com/recipe_embed_img/108566" style="display:inline;max-width:100%" width="370px" class="CToWUd">
</a>
@thanhluu
thanhluu / skrill.html
Created March 13, 2015 06:57
Welcome to Skrill
<body style="margin: 0">
<div bgcolor="#f4f4f4" style="padding:0px;margin:0px">
<table cellpadding="0" cellspacing="0" align="center" width="100%" border="0" bgcolor="#f4f4f4" style="background-color:#f4f4f4">
<tbody><tr>
<td valign="top"><table cellpadding="0" cellspacing="0" align="center" width="640" border="0">
<tbody><tr>
<td><table cellpadding="0" cellspacing="0" align="center" width="640" border="0">
<tbody><tr valign="middle">
<td width="20"><img src="https://ci6.googleusercontent.com/proxy/6xvFBkgu-s2tI6khCjF4p3_PnepAXqQAgi6gIqhaBHnPQcuGEzcixIowAxr1rQHKQaam6k9RLy442bU7HPXASflu8mN9ozAOErlAh6SoniGyjHSp7xlsC42MHthbYBFWTQIIHACGp6LzoPI=s0-d-e1-ft#https://www.skrill.com/creatives/images/nl/btc/p2p/2013/13-06/card-renewal/spacer.gif" width="1" height="1" alt="" title="" style="display:block" border="0" class="CToWUd"></td>
<td height="60"><table cellpadding="0" cellspacing="0" align="left" border="0">
@thanhluu
thanhluu / medium.html
Created March 13, 2015 07:06
Welcome to Medium
<body style="margin: 0"><div><table style="width:600px;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:40px;padding-right:20px;padding-bottom:40px;padding-left:20px;color:#333332;line-height:1.4;font-size:16px;font-weight:300;font-family:&quot;jaf-bernino-sans&quot;,&quot;Helvetica Neue&quot;,Helvetica,Lucida Grande,&quot;Lucida Sans Unicode&quot;,&quot;Lucida Sans&quot;,Geneva,Verdana,sans-serif"><tbody><tr><td><img src="https://ci5.googleusercontent.com/proxy/5mtCevush_P_mHp7o9c6ZxydGJSJMIA8dpI34IqdtLiXOPJ3fkCG6zYH3pL3kOH0wpiaXnIKTEa0yD2gKdjcge0_k74qUYMC98UIzm8CkMQzoz9fHWN4VY6HqS7SZyDGTIpOAjWEREvC=s0-d-e1-ft#https://dnqgz544uhbo8.cloudfront.net/_/fp/img/email/logo.dPr5ZCzgKMooKYKJwnKarQ.png" alt="Medium Logo" style="display:block;width:50px;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto" class="CToWUd"><img src="https://ci6.googleusercontent.com/proxy/gP-3I19YIZYvmIwKTQaO25HifkTWZ8z09oEZfqR00lTKU4OgpGuaPenkKKkXwXNnR87YTQ9ESzF81IOnq1rrLm-i0Q4QtY3lrhhynWt-4ah-v5YWd
@thanhluu
thanhluu / github.html
Last active August 29, 2015 14:17
thanhluu + GitHub = <3
<body style="margin: 0"><div bgcolor="#fafafa" marginheight="0" marginwidth="0" style="width:100%!important;background:#fafafa">
<div style="padding:10px">
<div style="padding-top:20px;width:550px;margin:0 auto">
<h1 style="margin:0;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:40px;letter-spacing:-1px;color:#333;font-weight:normal">
Welcome to GitHub
</h1>
<p style="margin:0 0 30px 0;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:17px;font-weight:300;color:#555">
You've taken your first step into a larger world, <strong style="color:#333">@thanhluu</strong>.
</p>
@thanhluu
thanhluu / zip-folder.php
Created March 28, 2015 03:37
Zip All Files inside Folder via PHP
<?php
// increase script timeout value
ini_set("max_execution_time", 300);
// create object
$root = dirname(__FILE__);
$folder = 'folder';
$zip = new ZipArchive();
// open archive
if ( $zip->open( $root . '/test-zip.zip', ZIPARCHIVE::CREATE | ZipArchive::OVERWRITE) !== TRUE) {
@thanhluu
thanhluu / codeship.io.yml
Created October 21, 2015 02:50
Test WordPress Theme from Bitbucket on Codeship
cd ..
# Install CodeSniffer for WordPress Coding Standards checks.
git clone https://github.com/squizlabs/PHP_CodeSniffer.git php-codesniffer
# Install WordPress Coding Standards.
git clone https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wordpress-coding-standards
# Hop into CodeSniffer directory.
cd php-codesniffer
# Set install path for WordPress Coding Standards
scripts/phpcs --config-set installed_paths ../wordpress-coding-standards
# After CodeSniffer install you should refresh your path.
@thanhluu
thanhluu / bin.sh
Last active October 21, 2015 08:52
Install WordPress for Testing via WP-CLI
wp core config --dbname=<$dbname> --dbuser=<$dbuser> --dbpass=<$dbpass>;
wp db reset --yes;
wp core install --url=<$url> --title=<$title> --admin_name=<$admin> --admin_email=<$email> --admin_password=<$password> --extra-php <<PHP
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
PHP;
curl -f https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml -o /tmp/theme-unit-test-data.xml;
wp import /tmp/theme-unit-test-data.xml --authors=skip;
wp plugin install developer --activate;
wp plugin install theme-check --activate;
@thanhluu
thanhluu / checkbase.php
Last active October 26, 2017 11:53
Ignore folder for theme check
// Search "$dir_iterator" then insert those codes below this line:
// $dir_iterator = new RecursiveDirectoryIterator( $dir );
$filter = array( 'framework', 'tools', 'vendor', 'lib', 'installer', 'updater' );
$dir_iterator = new \RecursiveCallbackFilterIterator(
$dir_iterator,
function( $item ) use ( $filter ) {
return ! in_array( $item->getBaseName(), $filter );
}
);
@thanhluu
thanhluu / style.css
Last active February 16, 2016 04:50
Show status of questions like DW Question & Answer 1.3
@import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');
.dwqa-questions-list .dwqa-question-item {
padding-left: 70px;
}
.dwqa-questions-list .dwqa-question-item .avatar {
position: static;
width: 12px;
height: 12px;