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
# force www in url | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] | |
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] | |
# END force www in 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
<!-- Sample Content to Plugin to Template --> | |
<h1>CSS Basic Elements</h1> | |
<p>The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p> | |
<hr /> | |
<h1 id="headings">Headings</h1> | |
<h1>Heading 1</h1> |
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
// Browser detection | |
// Internet Explorer | |
var ie = document.all != null; //ie4 and above | |
var ie5 = document.getElementById && document.all; | |
var ie6 = document.getElementById && document.all&&(navigator.appVersion.indexOf("MSIE 6.")>=0); | |
// Netscape | |
var ns4 = document.layers != null; | |
var ns6 = document.getElementById && !document.all; |
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 | |
function is_valid_email($email) | |
{ | |
if(preg_match("/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/", $email) > 0) | |
return true; | |
else | |
return 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
@-moz-document url-prefix() { | |
.date { | |
padding: 16px 0 0 0; | |
} | |
.date p span { | |
padding: 9px 0 3px 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
<!doctype html> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> | |
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline --> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> |
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
// jQuery code | |
var i = document.createElement("input"); | |
// Only bind if placeholder isn't natively supported by the browser | |
if (!("placeholder" in i)) { | |
$("input[placeholder]").each(function () { | |
var self = $(this); | |
self.val(self.attr("placeholder")).bind({ | |
focus: function () { | |
if (self.val() === self.attr("placeholder")) { |
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
@font-face { | |
font-family: 'MyWebFont'; | |
src: url('webfont.eot'); /* IE9 Compat Modes */ | |
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ | |
url('webfont.woff') format('woff'), /* Modern Browsers */ | |
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */ | |
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */ | |
} | |
body { |
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
jQuery.expr[':'].regex = function(elem, index, match) { | |
var matchParams = match[3].split(','), | |
validLabels = /^(data|css):/, | |
attr = { | |
method: matchParams[0].match(validLabels) ? | |
matchParams[0].split(':')[0] : 'attr', | |
property: matchParams.shift().replace(validLabels,'') | |
}, | |
regexFlags = 'ig', | |
regex = new RegExp(matchParams.join('').replace(/^s+|s+$/g,''), regexFlags); |
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 animals = [ | |
{ name: "Waffles", type: "dog", age: 12 }, | |
{ name: "Fluffy", type: "cat", age: 14 }, | |
{ name: "Spelunky", type: "dog", age: 4 }, | |
{ name: "Hank", type: "dog", age: 11 } | |
]; | |
// filter dogs | |
animals = animals.filter(function(animal) { | |
return animal.type === "dog"; |
OlderNewer