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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hello World</title> | |
</head> | |
<body> | |
<h1>Hello World</h1> | |
<!-- This is a comment.--> | |
<p>This is a website.</p> |
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
/************************************************************************************ | |
MEDIA QUERIES | |
*************************************************************************************/ | |
/* for 980px or less */ | |
@media screen and (max-width: 980px) { | |
#pagewrap { | |
width: 94%; | |
} | |
#content { | |
width: 65%; |
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 name="Gates", age=56, job="CEO"; | |
/* 多行 | |
var name="Gates", | |
age=56, | |
job="CEO"; | |
*/ |
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 | |
square = (x) -> x * x | |
fill = (container, liquid = "coffee") -> | |
"Filling the #{container} with #{liquid}..." | |
### JavaScirpt | |
var fill, square; | |
square = function(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
<script src="js/modernizr-x.x.x.js"></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
<?php | |
//加密解密方法 | |
function passport_encrypt($txt, $key) { | |
srand((double)microtime() * 1000000); | |
$encrypt_key = md5(rand(0, 32000)); | |
$ctr = 0; | |
$tmp = ''; | |
for($i = 0;$i < strlen($txt); $i++) { | |
$ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr; | |
$tmp .= $encrypt_key[$ctr].($txt[$i] ^ $encrypt_key[$ctr++]); |
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
// prolog hanoi | |
move(1,X,Y,\_):-write('Move top disk from '),write(X),write(' to '), write(Y), nl. | |
move(N,X,Y,Z):-N>1,M is N-1,move(M,X,Z,Y),move(1,X,Y,\_),move(M,Z,Y,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
//启动NodeJS服务 | |
var http = require('http'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}).listen(1337, '127.0.0.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
<?php | |
// 数据库主机 | |
define('C_DB_HOST', SAE_MYSQL_HOST_M); | |
//sae:数据库端口 | |
define('C_DB_PORT', SAE_MYSQL_PORT); | |
// 数据库用户名 | |
define('C_DB_USER', SAE_MYSQL_USER); | |
// 数据库密码 | |
define('C_DB_PASSWORD', SAE_MYSQL_PASS); | |
// 数据库名称 |
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 | |
/** | |
* wechat php test | |
*/ | |
//define your token | |
define("TOKEN", "YOUR_TOKEN"); | |
$wechatObj = new wechatCallbackapiTest(); | |
$wechatObj->valid(); |