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
SET var_RootPath=D:\folder | |
SET var_DestinationFolder=newfolder | |
FOR /D %%G in (%var_RootPath%\*) do ( | |
ECHO Folder is %%G | |
MD %%G\%var_DestinationFolder% | |
MOVE /Y %%G\* %%G\%var_DestinationFolder%\ | |
) |
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
/** | |
* Formats a file size as b, Kb, Mb etc | |
* @param (number) size File size in bytes | |
* @param (number) dec Number of decimal points to round to | |
*/ | |
function formatFileSize(size, dec) | |
{ | |
if(isNaN(dec)) dec = 2; | |
var multiply = Math.pow(10, dec); | |
var units = ['b','Kb','Mb','Gb','Tb','Pb']; |
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
Title 4 | |
Forename 50 | |
Surname 50 | |
Email address 255 | |
Address line 1 (street/building) 100 | |
Address line 2 (street) 100 | |
Address line 3 (town) 50 | |
Address line 4 (region) 50 | |
Address line 5 (post code) 7 | |
Telephone number 12 |
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 | |
// Based upon http://stackoverflow.com/a/2202489/189469 | |
function explodeWithQuotes($string) { | |
preg_match_all('/"(?:\\\\.|[^\\\\"])*"|\S+/', $string, $result); | |
return $result[0]; | |
} | |
?> |
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 | |
$itemTag = 'item'; | |
$tags = array( | |
'title', | |
'guid' | |
); | |
$url = 'http://feeds.bbci.co.uk/news/rss.xml'; | |
$feed = rss_to_array($itemTag, $tags, $url); | |
$limit = 10; |
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
$('input').on('keypress', function (e) { | |
var code = e.which ? e.which : e.keyCode; | |
if ((code !== 46 && code > 31 && (code < 48 || code > 57)) || (code === 46 && $(this).val().indexOf('.') > -1)) { | |
e.preventDefault(); | |
} | |
}); |
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 getParameterByName(name) { | |
var match = new RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search); | |
return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); | |
} |
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 | |
try { | |
$db = new PDO('mysql:host=localhost;dbname=dbname', 'username', 'password'); | |
} catch (PDOException $e) { | |
die($e->getMessage()); | |
} | |
?> |
NewerOlder