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 trim(str, chars) { | |
return ltrim(rtrim(str, chars), chars); | |
} | |
function ltrim(str, chars) { | |
chars = chars || "\\s"; | |
return str.replace(new RegExp("^[" + chars + "]+", "g"), ""); | |
} | |
function rtrim(str, chars) { | |
chars = chars || "\\s"; | |
return str.replace(new RegExp("[" + chars + "]+$", "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
val = (numberA / numberB) | 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 | |
if(isset($_REQUEST['rd'])) { | |
$new = $_REQUEST['rd']; | |
// DB access | |
include("db.php"); | |
$sql = "SELECT rdURL FROM rd WHERE rdName='".$new." LIMIT 1';"; | |
$result = mysql_query($sql); | |
mysql_close($conn); | |
if($result) { | |
$row = mysql_fetch_array($result); |
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
public static string b2s(byte b) { | |
string result = Convert.ToString(b, 2); | |
while(result.Length < 8 ) result = "0" + result; | |
return result; | |
} |
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
<script> | |
document.write("<a href='mailto:" + 'moc.elpmaxe@em'.split("").reverse().join("") + "'>email</a>"); | |
</script> |
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
<a href="irrevocable-action.php?doitnow=yes" onclick="return confirm('Are you really, really, really sure you want to do this?')">Do It!!</a> |
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
private const int _length = 15; | |
private static string RandomAlphaString { | |
get { | |
var ret = ""; | |
var random = new Random(); | |
while (ret.Length < _length) | |
if (random.Next(1, 9) % 2 == 0) | |
ret = ret + Convert.ToChar(random.Next(65, 90)); | |
else | |
ret = ret + Convert.ToChar(random.Next(97, 122)); |
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 checkClose() { | |
if (ok) { | |
return "Have you saved your information?"; | |
} | |
} | |
var ok = true; // this is reset everytime a new page is loaded | |
function okToLeave() { // called if leaving the page is needed | |
ok = 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
if(!$_REQUEST["client_time"]) | |
{ | |
$vars = "?"; | |
foreach($_REQUEST as $key => $val) { | |
$vars .= $key."=".$val."&"; | |
} | |
echo "<script type=\"text/javascript\">"; | |
echo "localtime = new Date();"; | |
echo "document.location.href = '".$PHP_SELF.$vars."client_time=' | |
+ localtime.getTime();"; |
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
$string = strrev(substr(strrev($string), 2)); |
OlderNewer