This file contains hidden or 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
/* Simple spam protection for email addresses using jQuery. | |
* Well, the protection isn’t jQuery-based, but you get the idea. | |
* This snippet allows you to slightly ‘obfuscate’ email addresses to make it harder for spambots to harvest them, while still offering a readable address to your visitors. | |
* E.g. | |
* <a href="mailto:foo(at)example(dot)com">foo at example dot com</a> | |
* → | |
* <a href="mailto:[email protected]">[email protected]</a> | |
*/ | |
$(function() { |
This file contains hidden or 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
#Block comment spammers, bad bots and some proxies | |
RewriteCond %{REMOTE_HOST} 24.117.121.113 [OR] | |
RewriteCond %{REMOTE_HOST} ^211.138.198.* [OR] | |
RewriteCond %{REMOTE_HOST} 216.246.60.183 [OR] | |
RewriteCond %{REMOTE_HOST} 203.94.229.227 [OR] | |
RewriteCond %{REMOTE_HOST} 91.121.3.29 [OR] | |
RewriteCond %{REMOTE_HOST} 210.0.141.247 [OR] | |
RewriteCond %{REMOTE_HOST} 210.197.97.67 [OR] | |
RewriteCond %{REMOTE_HOST} 74.95.182.57 [OR] | |
RewriteCond %{REMOTE_HOST} 222.36.12.42 [OR] |
This file contains hidden or 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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
This file contains hidden or 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-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Html 5 Template with Microdata included</title> | |
<link rel="icon" type="image/png" href="http://example.com/myicon.png"> | |
<link rel="stylesheet" type="text/css" media="all" href="css/style.css" /> | |
<!--link rel="stylesheet/less" type="text/css" href="public/css/home.less"> | |
<script src="public/js/less-1.3.0.min.js" type="text/javascript"></script--> | |
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> |
This file contains hidden or 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 // Collection of useful php snippets | |
// html readable print_r for arrays | |
echo '<pre>'; | |
print_r($myarray); | |
echo '</pre>'; | |
?> |
This file contains hidden or 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 | |
/** | |
* Array: Find previous element (method 1) | |
* @source http://stackoverflow.com/questions/4792673/php-get-previous-array-element-knowing-current-array-key | |
*/ | |
$array = array( | |
12 => array('a','b'), | |
34 => array('c','d'), | |
56 => array('e','f') |
This file contains hidden or 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
<html> | |
<head> | |
<title>RSS Feed Reader</title> | |
</head> | |
<body> | |
<?php | |
//Feed URLs | |
$feeds = array( | |
"http://maxburstein.com/rss", | |
"http://www.engadget.com/rss.xml", |
This file contains hidden or 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 return array ( | |
'url' => 'https://xaviesteve.com/', | |
'content' => '<!doctype html><html>...</html>', | |
'cookies' => '__cfduid=d3fa669e1069e72c2e47d127ab9b8e11f1465390629', | |
'http_code' => 200, | |
'content_type' => 'text/html; charset=UTF-8', | |
'header_size' => 578, | |
'request_size' => 229, | |
'filetime' => -1, | |
'ssl_verify_result' => 0, |
This file contains hidden or 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 | |
public function view($filename = 'home') { | |
// Default values for every View | |
$data = array( | |
"app_title" => $this->app_title, | |
"app_tagline" => $this->app_tagline, | |
"app_url" => $this->app_url, | |
"app_version" => $this->app_version, | |
"user_name" => $this->user_name, | |
); |
This file contains hidden or 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 | |
function encodecsv($string) { | |
if(strpos($string, ',') !== false || strpos($string, '"') !== false || strpos($string, "\n") !== false) { | |
$string = '"' . str_replace('"', '""', $string) . '"'; | |
} | |
return $string; | |
} |
OlderNewer