Skip to content

Instantly share code, notes, and snippets.

<!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>
/************************************************************************************
MEDIA QUERIES
*************************************************************************************/
/* for 980px or less */
@media screen and (max-width: 980px) {
#pagewrap {
width: 94%;
}
#content {
width: 65%;
// 单行
var name="Gates", age=56, job="CEO";
/* 多行
var name="Gates",
age=56,
job="CEO";
*/
# function
square = (x) -> x * x
fill = (container, liquid = "coffee") ->
"Filling the #{container} with #{liquid}..."
### JavaScirpt
var fill, square;
square = function(x) {
<script src="js/modernizr-x.x.x.js"></script>
<?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++]);
// 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).
@wlyecn
wlyecn / node1.js
Last active December 30, 2015 00:29
//启动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');
@wlyecn
wlyecn / sae1.php
Last active December 30, 2015 00:29
<?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);
// 数据库名称
@wlyecn
wlyecn / WechatTest.php
Last active October 21, 2016 23:23
php: wechat basic
<?php
/**
* wechat php test
*/
//define your token
define("TOKEN", "YOUR_TOKEN");
$wechatObj = new wechatCallbackapiTest();
$wechatObj->valid();