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
// Selecting all p that are next siblings of h1: | |
h1 + p { ... } | |
// Selecting all h1 that are *previous* siblings of p: | |
h1:has(+ p) |
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
//define the receiver of the email | |
$to = '[email protected]'; | |
//define the subject of the email | |
$subject = 'Test email with attachment'; | |
//create a boundary string. It must be unique | |
//so we use the MD5 algorithm to generate a random hash | |
$random_hash = md5(date('r', time())); | |
//define the headers we want passed. Note that they are separated with \r\n | |
$headers = "From: [email protected]\r\nReply-To: [email protected]"; | |
//add boundary string and mime type specification |
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
# Use cpan and the module name to install the module | |
cpan NET::SFTP |
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
<select name="state"> | |
<option value="ACT">Australian Capital Territory</option> | |
<option value="NSW">New South Wales</option> | |
<option value="NT ">Northern Territory</option> | |
<option value="QLD">Queensland</option> | |
<option value="SA ">South Australia</option> | |
<option value="TAS">Tasmania</option> | |
<option value="VIC">Victoria</option> | |
<option value="WA ">Western Australia</option> | |
</select> |
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
visudo | |
# Add the line | |
nobody ALL=(ALL)NOPASSWD:/usr/bin/perl | |
# replace nobody with whatever your apache user 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
var set1 = [2, 4, 6, 8, 10]; | |
var set2 = [2, 4, 5, 8, 10]; | |
console.log(set1.every(function (a) { | |
return a % 2 === 0; | |
})); // true | |
console.log(set2.every(function (a) { | |
return a % 2 === 0; | |
})); // false |
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
$countries = array( | |
'AD' => 'Andorra', | |
'AE' => 'United Arab Emirates', | |
'AF' => 'Afghanistan', | |
'AG' => 'Antigua & Barbuda', | |
'AI' => 'Anguilla', | |
'AL' => 'Albania', | |
'AM' => 'Armenia', | |
'AN' => 'Netherlands Antilles', | |
'AO' => 'Angola', |
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
<!doctype html> | |
<html> | |
<head> | |
<!-- Run in full-screen mode. --> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<!-- Make the status bar black with white text. --> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black"> |
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
// Append to a filename | |
function appendToFilename($file,$append) { | |
return preg_replace('/(\.[^.]+)$/', sprintf('%s$1', $append), $file); | |
} |
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
function createEmail($to,$from,$subject,$content,$cc=false,$bcc=false) { | |
$headers = "From:$from\r\n"; | |
$headers .= "CC:".$bcc."\r\n"; | |
$headers .= "BCC:".$bcc."\r\n"; | |
$headers .= "MIME-Version: 1.0\r\n"; |
NewerOlder