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
//http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/#modulepatternjavascript | |
var User = (function(){ | |
var _Name, _Surname; | |
return { | |
getName : function(){ | |
return _Name; | |
}, | |
setName : function(value) { | |
if(value !== undefined){ |
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
<script id="child-template" type="text/mustache"> | |
{{#.}} | |
<div class="child-wrapper"> | |
<div class="child-name-wrapper">{{name}}</div> | |
<div class="child-birthdate-wrapper">{{birthdate}}</div> | |
<div class="child-gender-wrapper">{{gender}}</div> | |
</div> | |
{{/.}} | |
</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
;function isDate(value) { | |
try { | |
//Change the below values to determine which format of date you wish to check. It is set to dd/mm/yyyy by default. | |
var YearIndex = 2; | |
var MonthIndex = 1; | |
var DayIndex = 0; | |
value = value.replace(/-/g, "/").replace(/\./g, "/"); | |
var SplitValue = value.split("/"); | |
var OK = true; |
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
javascript:alert(document.querySelector('meta[name="description"]').getAttribute('content')) |
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
//Duplicate of : https://gist.github.com/anova/169824fa1f0f458b4ab3 | |
//I forgot, sorry for duplication |
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
<?xml version="1.0"?> | |
<configuration> | |
<system.webServer> | |
<httpRedirect enabled="true" destination="http://www.example.com" httpResponseStatus="Permanent" /> | |
</system.webServer> | |
</configuration> |
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> | |
<head> | |
<title>Screen resolution</title> | |
<meta name="viewport" content="initial-scale=1.0, width=device-width" /> | |
<style> | |
html,body{ height: 100%; } | |
</style> | |
<script> | |
function writeScreenResolution(){ |
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
//this script is inline for avoid extra request. | |
var fonts = new Array(); | |
fonts.push('css/font/pfsquaresanspromedium.css'); | |
fonts.push('css/font/pfhighwaysanspro-thin.css'); | |
fonts.push('css/font/ubuntu-m.css'); | |
fonts.push('css/font/pfhighwaysanspro-regular-light-italic.css'); | |
fonts.push('css/font/pfsquaresanspro-italic-regular.css'); | |
var head = document.getElementsByTagName('head')[0]; | |
var link = document.getElementsByTagName('link')[0]; | |
for(var i in fonts) { |
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 | |
if ( !isset($_SERVER['SPI'])) { | |
die(); | |
} | |
if (!isset($_SERVER['DOCUMENT_ROOT'])) { | |
echo("CRITICAL: we seem to be running outside of the norm.\n"); | |
header("Location: http://".$_SERVER["HTTP_HOST"]."/"); | |
die("CRITICAL: Document root unavailable.\n"); |