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
' regsvr32 wsh | |
Dim objShell | |
Set objShell = CreateObject("WScript.Shell") | |
objShell.Run "regsvr32.exe c:\windows\system32\whatever.dll" |
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 | |
// google feed api | |
$url = "http://rss.cnn.com/rss/cnn_topstories.rss"; | |
//$data = file_get_contents("http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&output=json&q=$url"); | |
$data = file_get_contents("http://www.google.com/uds/Gfeeds?num=5&hl=en&output=json&q=$url&v=1.0&nocache=0"); | |
$data = json_decode($data); | |
var_dump($data); |
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 | |
ini_set('post_max_size','11M'); | |
ini_set('upload_max_filesize','10M'); | |
?> |
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 | |
private function disable_register_globals(){ | |
if(ini_get('register_globals')){ | |
foreach(get_defined_vars() as $var=>$val){ | |
if(!in_array($var,array('_GET','_POST','_COOKIE','_SERVER'))){ | |
unset($$var); | |
} | |
} | |
} | |
} |
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 | |
private function disable_magic_quotes(){ | |
if(ini_get('magic_quotes_gpc')){ | |
function strip_all_params(&$item){ $item = stripslashes($item); } | |
array_walk_recursive($_GET,'strip_all_params'); | |
array_walk_recursive($_POST,'strip_all_params'); | |
} | |
} |
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 deltatime = 24 * 60 * 60; // 24h | |
var last = GM_getValue("lastcheck", new Date().getTime() / 1000); | |
if (new Date().getTime() / 1000 - last > deltatime) { | |
checkUpdates(); | |
GM_setValue("lastcheck", Math.round(new Date().getTime() / 1000)); | |
} |
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 urlParam(name, _default) { | |
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]") | |
var regexS = "[\\?&]" + name + "=([^&#]*)" | |
var regex = new RegExp(regexS) | |
var results = regex.exec(window.location.href) | |
if (results == null) { | |
return _default | |
} | |
else { | |
return results[1] |
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 | |
// filter_input examples | |
// Make sure it is an integer | |
$integer = filter_input(INPUT_POST, 'variable_name', FILTER_SANITIZE_NUMBER_INT); | |
// Make it safe to use in a URL | |
$url_string = filter_input(INPUT_POST, 'variable_name', FILTER_SANITIZE_ENCODED); | |
// Make sure it is a valid URL |
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
svn resolve --accept working -R . |
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 | |
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__))) as $item) { | |
if (!$item->isDir() || $item->isDot()) continue; | |
echo $item, PHP_EOL; | |
} | |
?> |