Skip to content

Instantly share code, notes, and snippets.

View QETHAN's full-sized avatar
🎯
Focusing

QETHAN QETHAN

🎯
Focusing
View GitHub Profile
@QETHAN
QETHAN / flbox.js
Created April 28, 2013 04:48
简易弹框模块,采用SeaJS加载
/**
* 简易弹框
*/
define(function(require, exports) {
var funCreate = require("./elementCreate")
, funAjax = require("./ajax")
, overlay = require("./overlay");
var eleWin = funCreate.create("div", {
@QETHAN
QETHAN / overlay.js
Created April 28, 2013 04:50
黑色半透明遮罩 SeaJS
/**
* 黑色半透明遮罩层
*/
define(function(require, exports, module) {
var elementCreate = require("./elementCreate");
var overlay = (function() {
var element = elementCreate.create("div", {
styles: {
display: "none",
@QETHAN
QETHAN / elementCreate.js
Created April 28, 2013 04:52
创建元素 SeaJS
/**
* 创建元素
*/
define(function(require, exports) {
exports.create = function(tagName, attr) {
var element = null;
if (typeof tagName === "string") {
element = document.createElement(tagName);
/**
* ajax方法
*/
define(function(require, exports) {
exports.get = function(url, succCall) {
if (url == undefined) {
console.log("请求地址缺失!");
return;
}
/**
* URL地址后面增加随机参数
*/
define(function(require, exports, module) {
exports.queryRandom = function(url) {
var strQueryRandom = "random=" + Math.random();
var arrQuery = url.split("?");
if (arrQuery[1] != undefined) {
/**
* 主线js
* 点击小图查看大图测试
*/
define(function(require, exports) {
var query = require("./queryRandom")
, flbox = require("./flbox");
exports.bind = function(element) {
element.onclick = function() {
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="description" content="seajs spm使用测试之简易弹框实现 » 张鑫旭-鑫空间-鑫生活" />
<meta name="description" content="seajs spm使用测试之简易弹框实现之实例页面" />
<meta name="keywords" content="seajs, spm, node.js, nodejs" />
<meta name="author" content="张鑫旭, zhangxixnu" />
<title>seajs使用测试之简易弹框实现 &raquo; 张鑫旭-鑫空间-鑫生活</title>
<style>
@QETHAN
QETHAN / node验证码实现
Created May 17, 2013 13:57
node验证码实现
csser 使用的最简单的验证码,用的 node-canvas 模块
var Canvas = require('canvas');
module.exports = function (req, res) {
var canvas = new Canvas(100, 30),
ctx = canvas.getContext('2d'),
items = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPRSTUVWXYZ23456789'.split(''),
vcode = '',
textColors = ['#FD0', '#6c0', '#09F', '#f30', '#aaa', '#3cc', '#cc0', '#A020F0', '#FFA500', '#A52A2A', '#8B6914', '#FFC0CB', '#90EE90'];
将mongodb的bin目录加入PATH环境变量中,例如:
export PATH=~/Develope-Tools/mongodb/bin:$PATH
,然后在主目录的.profile文件中增加shell命令的alias,如下:
alias mongostart="mongod -f ~/.mongodb.conf"
<html>
<head>
<script type="text/javascript">
alert(h);//function.....
alert(a);//undefined
var a = 3;
function h() {
alert('22');
}