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 | |
/** | |
* Returns an array of filenames for a given directory | |
* | |
* @param string $directory The directory of files to list | |
* @return array the array of files | |
*/ | |
function getDirectoryList($directory){ | |
$files= array(); | |
$h = opendir($directory); |
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 stripHTML($str) { | |
preg_match_all('#</?pre(>|\s[^>]*>)(.*?)</pre(>|\s[^>]*>)#is',$str,$matches); | |
foreach($matches[2] as $match){ | |
$str = str_replace($match, htmlspecialchars($match),$str); | |
} | |
$str = preg_replace("/<\?/","<?",$str); | |
$str = preg_replace("/\?>/","?>",$str); | |
return $str; | |
} |
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
#include <stdlib.h> | |
#include<iostream> | |
using namespace std; | |
/** | |
* Estimates the increase in horsepower of a car based on weight and a change in 0 to 60 times. | |
* | |
* @author Jimmy Goodsell | |
*/ |
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
// Copyright (c) 2011, Max Vandervelde | |
// Released under the MIT license | |
// | |
// -------------------------------------------------------------------- | |
// | |
// This is a Greasemonkey user script. To install it, you need | |
// Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/ | |
// Then restart Firefox and revisit this script. | |
// Under Tools, there will be a new menu item to "Install User 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
// Copyright (c) 2011, Max Vandervelde | |
// Released under the MIT license | |
// | |
// -------------------------------------------------------------------- | |
// | |
// This is a Greasemonkey user script. To install it, you need | |
// Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/ | |
// Then restart Firefox and revisit this script. | |
// Under Tools, there will be a new menu item to "Install User Script". | |
// Accept the default configuration and install. |
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 | |
class User extends SQLObject { | |
static function structure(){ | |
self::field("name","varchar(32)"); | |
self::field("email","varchar(127)"); | |
self::field("verified","varchar(64)"); | |
} | |
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
links = document.getElementById("box"); | |
for(x=0;x<links.length;++x){ | |
if(links[x].innerHTML == "blah1"){ | |
links[x].style.display="none"; | |
} | |
//or | |
if(links[x].getAttribute("href")=="blah1.html"){ | |
links[x].style.display="none"; | |
} | |
} |
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 markDown($str){ | |
//Tag like markdown, ordered by precedence. | |
//This is the only thing you really need to configure. | |
//It's a regular expression (without delimiters) as the key and the desired output as the value. | |
$markdownSet = array( | |
"\_\*(.*)\*_" => " <b><i>$2</i></b> ", |
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
// Copyright (c) 2011, Max Vandervelde | |
// Released under the MIT license | |
// | |
// -------------------------------------------------------------------- | |
// | |
// This is a Greasemonkey user script. To install it, you need | |
// Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/ | |
// Then restart Firefox and revisit this script. | |
// Under Tools, there will be a new menu item to "Install User Script". | |
// Accept the default configuration and install. |
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
<? | |
include "time.php"; | |
$ugly = "2012-03-16 00:12:29"; | |
$pretty = Time\readable($ugly); | |
echo $pretty; | |
?> |
OlderNewer