Skip to content

Instantly share code, notes, and snippets.

View xiaojue's full-sized avatar
🤚
waiting

xiaojue xiaojue

🤚
waiting
View GitHub Profile
@xiaojue
xiaojue / css.node
Created April 1, 2014 08:56
css.node
var combine = addModule('css-combine');
var u = require('url');
var fs = require('fs');
var path = require('path');
var qs = require('querystring');
logger.log(123);
route(function(req,res){
var file = decodeURIComponent(qs.parse(u.parse(req.url).query).file) + '.css';
file = path.resolve(__dirname,file);
/**
* Clipboard.js
*
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
var Event = {
map: {},
_addqueue: function(el, type, fn, init) {
var queue = Event.map[type + el];
if (!queue) {
queue = [];
init();
}
queue.push(fn);
},
/*
* dom操作虚拟类
* contructor Elem Node
* 依赖 DOMUtil Util dtd filterHtml
* @author luying1@staff
**/
(function() {
/*
* Elem
@xiaojue
xiaojue / liveweb.js
Created October 23, 2014 15:02
liveweb
var express = require('express')
var http = require('http')
var net = require('net');
var child = require('child_process');
var app = express();
var httpServer = http.createServer(app);
app.get('/', function(req, res) {
var date = new Date();
@xiaojue
xiaojue / .jshintrc
Last active August 29, 2015 14:25
jshintrc
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : true, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@xiaojue
xiaojue / .jsbeautifyrc
Created July 21, 2015 04:28
jsbeautifyrc
{
"indent_size": 4,
"indent_char": " ",
"eol": "\n",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 10,
"jslint_happy": false,
"space_after_anon_function": false,
@xiaojue
xiaojue / common.css
Created August 27, 2015 13:18
common.css
/*css reset*/
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;outline:0}html,body,form,fieldset,p,div,h1,h2,h3,h4,h5,h6{-webkit-text-size-adjust:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block;clear:both;}
html { font-family: 'Microsoft YaHei',"Helvetica Neue", Helvetica, STHeiTi, Arial, sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-size: 62.5%; }
body {font-size: 1.4rem;overflow-x: hidden;min-width:320px; /*-webkit-overflow-scrolling: touch;*/color:#1a1a1a;background:#f9f9f9; }
a { background: transparent; text-decoration: none; -webkit-tap-highlight-color: transp
@xiaojue
xiaojue / rem.js
Created October 13, 2015 13:48
rem.js
/*
* rem.js
* v0.1.1
* fixed 2015-3-12
*/
(function (win){
var doc = win.document,
html = doc.documentElement,
option = html.getAttribute('data-use-rem');
@xiaojue
xiaojue / t.js
Last active March 18, 2025 01:47
countdown
/**
* @author xiaojue
* @date 20160420
* @fileoverview 倒计时
*/
(function() {
function timer(delay) {
this._queue = [];
this.stop = false;