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 | |
// Generates a strong password of N length containing at least one lower case letter, | |
// one uppercase letter, one digit, and one special character. The remaining characters | |
// in the password are chosen at random from those four sets. | |
// | |
// The available characters in each set are user friendly - there are no ambiguous | |
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option, | |
// makes it much easier for users to manually type or speak their passwords. | |
// | |
// Note: the $add_dashes option will increase the length of the password by |
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 FlashMessages { | |
private $messages = array(); | |
private $now = false; | |
private static $instance = null; | |
private function __construct() { | |
// Save all messages | |
$this->messages = $_SESSION['flash_messages']; |
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 | |
// Source: http://www.jonasjohn.de/snippets/php/headers.htm | |
// Use this header instruction to fix 404 headers | |
// produced by url rewriting... | |
header('HTTP/1.1 200 OK'); | |
// Page was not found: | |
header('HTTP/1.1 404 Not Found'); |
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
// plug it in, plug it in | |
(function($) { | |
var paraCount = function() { | |
return { | |
options: { | |
itemClass: 'awesome', | |
baseUrl: "/", |
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
# CSS/JS auto-versioning | |
RewriteEngine On | |
RewriteRule ^(.*)\.[\d]{10}\.(css|js)$ $1.$2 [L] |
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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>CSS drop-shadows without images</title> | |
<style> | |
body { | |
padding:20px 0 30px; | |
font:14px/1.5 Arial, sans-serif; | |
text-align:center; |
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 | |
$i=0; | |
while($c = $db->getNextSet(true)): | |
print '<li class="'.($i++%2==0 ? 'odd' : 'even').'">Zebras yo!</li>'; | |
endwhile; | |
?> |
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
wget -nc -nH -E -r -k -P /home/you/example.com -np http://example.com/ |
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 | |
$bad = array_merge(array_map('chr', range(0,31)), array("<", ">", ":", '"', "/", "\\", "|", "?", "*", " ")); | |
$result = str_replace($bad, "-", $filename); | |
?> |
OlderNewer