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 | |
$data = (object)array( | |
"html" => "<foo bar=\"baz\"/> &", | |
"arabic" => "العربية al-ʿarabiyyah, IPA: [æl ʕɑrɑˈbijjɐ], or عربي ʿarabī", | |
"hebrew" => "עִבְרִית, Ivrit", | |
"chinese" => "汉语/漢語 Hanyu; 华语/華語 Huáyǔ; 中文 Zhōngwén", | |
"korean" => "한국어/조선말", | |
"japanese" => "日本語 Nihongo", | |
"umlauts" => "äüöãáàß", |
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 | |
/* | |
determine which language out of an available set the user prefers most | |
$available_languages array with language-tag-strings (must be lowercase) that are available | |
$http_accept_language a HTTP_ACCEPT_LANGUAGE string (read from $_SERVER['HTTP_ACCEPT_LANGUAGE'] if left out) | |
*/ | |
function negotiate_language ($available_languages,$http_accept_language="auto") { | |
// if $http_accept_language was left out, read it from the HTTP-Header | |
if ($http_accept_language == "auto") $http_accept_language = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : ''; |
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
#/usr/bin/bash | |
opt=$1 | |
root=`hg root` | |
stash=$root/.stash | |
if [ -z $opt ] | |
then | |
opt='save' | |
fi |
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
function rmdir_r($dir) { | |
if (!is_dir($dir)) { | |
return false; | |
} | |
$files = scandir($dir); | |
foreach ($files as $file) { | |
if ($file === '.' || $file === '..') { | |
continue; | |
} |
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> | |
<title>Curly Bracket</title> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<style> | |
.curlyBrace { | |
stroke: #000000; | |
stroke-width: 10px; |
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
struct edgenode | |
{ | |
int no; | |
struct edgenode *next; | |
}; | |
struct vex | |
{ | |
struct edgenode *first; | |
}; |
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
<style> | |
.img-outSide{ | |
width: 500px; | |
height: 750px; | |
border: 1px solid #CDCDCD; | |
text-align: center; | |
} | |
.img-inSide,.img-con{ | |
display: inline-block; | |
vertical-align: middle; |
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 | |
HTML 5: | |
<!DOCTYPE html> | |
HTML 4.01 transitional: | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
HTML 4.01 strict: | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
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
<FilesMatch "\.(gif|jpe?g|png)$"> | |
RewriteEngine On | |
RewriteCond %{QUERY_STRING} ^download$ | |
RewriteRule ^.*$ - [E=DOWNLOAD:1] | |
Header set Content-Type application/octet-stream env=DOWNLOAD | |
Header set Content-Disposition attachment env=DOWNLOAD | |
</FilesMatch> |
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
/* IE Hacks*/ | |
/** | |
* slideDown on element with position set to relative, the element will display first and then it will disappear. | |
* @for IE7 | |
*/ | |
.container { | |
position: relative; | |
overflow: hidden; /* hack: BFC or hasLayout issue */ | |
} |
NewerOlder