This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wp_mail_content_type', 'set_html_content_type' ); | |
$headers[] = 'From: Sender of Mail <mail@yourblog.com>'; | |
wp_mail( | |
$guest_info['guest_email'], | |
'Title of The Mail', | |
'<html><body><p>This is the content of the mail<br /> | |
This is the content of the mail. <br /><br /> | |
<strong>another html strong tag test.</strong><br /><br /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from | |
http://fearlessflyer.com/2009/08/getting-rid-of-unwanted-backslashes-in-wordpress-form-input/ | |
<?php | |
//by using stripslashes_deep, you can dodge trailing slash problems in wp_mail or any kind of form-provided contents | |
//before PHP 5.3. | |
if ( get_magic_quotes_gpc() ) { | |
$_POST = array_map( 'stripslashes_deep', $_POST ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usermod -a -G www-data invvvvent | |
id invvvvent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#from http://lowendtalk.com/discussion/8203/quick-trick-drop-all-tables-in-mysql-database-in-one-step | |
mysqldump -u${user} -p${pass} -h ${host} --add-drop-table --no-data ${database} | grep ^DROP | mysql -u${user} -p${pass} -h ${host} ${database} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Magic absolute centering recipe | |
http://jsfiddle.net/sairion/XhtwU/ | |
*/ | |
div{ | |
background: red; | |
bottom: 0; | |
height: 100px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Reference: http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ | |
* Description: Java-like OO concept implemented in JavaScript. | |
*/ | |
//init __superclass @Animal as form of JavaScript function. | |
var Animal = function(){}; | |
//function works as __constructor either. (**has to have same-named function!) | |
var Animal = function Animal( color ){ this.color = color }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Type of testing: | |
Static testing / Regression testing | |
"The intent of regression testing is to provide a general assurance that no additional errors were introduced in the process of fixing other problems." | |
"Regression test is a test that is performed to make sure that previously working functionality still works, after changes elsewhere in the system. Wikipedia article is pretty good at explaining what it is." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SQL Basics by topics */ | |
*Keys | |
-Foreign Key, Primary Key, | |
*Transation | |
-ACID (Atomicity, Consistency, Isolation, Durability) == "set of properties that guarantee that database transactions are processed reliably." (Wikipedia) | |
-Commit / Rollback after process | |
*Concurrency Control (Controlling Concurrent Transaction, interleaving excution of transaction) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$c = curl_init('http://google.com'); | |
curl_setopt($c, CURLOPT_RETURNTRANSFER, true); | |
//curl_setopt(... other options you want...) | |
$html = curl_exec($c); | |
if (curl_error($c)){ die(curl_error($c)); } | |
// Get the status code | |
$status = curl_getinfo($c, CURLINFO_HTTP_CODE); | |
curl_close($c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* default function param value | |
*/ | |
var getOuterWidth = function(Elem, Width, Padding){ | |
//assigning default value | |
Width = Width || 0; | |
Padding = Padding || 0; | |
//... | |
} |