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
/** | |
* extract host name from URL string. | |
*/ | |
function getHost(url) { | |
var m = url.match(/^https?:\/\/([^\/:\d]+)/); | |
return m && m[1]; | |
} | |
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
/** | |
* Simple template function. | |
* | |
* For each pattern in argument template, it is replaced with actual property from argument data. | |
* t('{greeting} world', {greeting: 'hello'}) === 'hello world' | |
* | |
* Sequence of property in argument data doesn't matter: | |
* t('{g} {x}', {g: '{o}', o: 'x'})) === '{o} {x}' | |
* t('{g} {x}', {o: 'x', g: '{o}'})) === '{o} {x}' | |
* |
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 | |
$arr = array( | |
'Color' => array('Red', 'Blue'), | |
'Size' => array('Regular', 'Large'), | |
'Material' => array('Metalic', 'Nylon') | |
); | |
function magic_algorithm($arr){ | |
function cartesian_product($arrays) { |
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>Test</title> | |
<link rel="stylesheet" type="text/css" href="/yui/assets/yui.css?v=3" > | |
<script src="http://yui.yahooapis.com/combo?2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"</script> | |
<!-- Browser History Manager source file --> | |
<style type="text/css" media="screen"> |
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 escapeHTML(s) { | |
return s.replace(/&/g, '&').replace(/>/g, '>').replace(/</g,'<').replace(/"/g, '"').replace(/'/g,''').replace(/\//g,'/'); | |
} |
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> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>MVC Demo</title> | |
</head> | |
<body> | |
{{name}} is {{title}}. | |
</body> | |
</html> |
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 foo = obj.foo; | |
obj.foo = function() { | |
// do something | |
obj.foo = foo; | |
obj.foo(arguments); | |
}; |
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
<copy file="${builddir}/files/moduletemplate.txt" tofile="@{file}" overwrite="true"> | |
<filterset> | |
<filter token="CODE" value="${@{module}-@{file}-code}" /> | |
<filter token="YUIVAR" value="${yui.variable}" /> | |
<filter token="MODULE" value="@{module}" /> | |
<filter token="DETAILS" value="${@{module}-details}" /> | |
<filter token="VERSION" value="${component.version}" /> | |
<filter token="MUSTACHE_TEMPLATE" value="${component.mustache.template}" /> | |
</filterset> | |
</copy> |
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
DirectoryIndex index.php | |
RewriteEngine on | |
RewriteCond $1 !^(index\.php|img|style|js|robots\.txt|favicon\.ico) | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] |
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
<VirtualHost *> | |
ServerName xxx.xxx.com | |
DocumentRoot "/var/www/html" | |
DirectoryIndex index.php | |
SetEnv XXX_ENV "development" | |
</VirtualHost> |
OlderNewer