Skip to content

Instantly share code, notes, and snippets.

View barretlee's full-sized avatar
💭
Make things happen!

Barret李靖 barretlee

💭
Make things happen!
View GitHub Profile
@barretlee
barretlee / Marquee.js
Last active December 20, 2015 07:49
Marquee class gist
/**
* @author 靖鸣君
* @email barret.china@163.com
* @description 滚动
* @class Marquee
* @param {Object}
*/
var Marquee = function(){
this.direction = "top";
this.speed = 30;
@barretlee
barretlee / tplEngine Demo
Last active July 9, 2019 15:23
tplEngine Demo
var tpl = '<% for(var i = 0; i < this.posts.length; i++) {' + 
'var post = this.posts[i]; %>' +
'<% if(!post.expert){ %>' +
'<span>post is null</span>' +
'<% } else { %>' +
'<a href="#"><% post.expert %> at <% post.time %></a>' +
'<% } %>' +
'<% } %>';
var data = {
@barretlee
barretlee / barretTpl Demo
Created December 3, 2013 08:12
barretTpl Demo
<!DOCTYPE HTML>
<body>
<style type="text/css">
textarea, button, div {
display: inline-block;
vertical-align: middle;
margin-right:30px;
}
textarea {
width:500px;

常用的 HTML 头部标签

详细介绍参见原文:yisibl/blog#1

<!DOCTYPE html> <!-- 使用 HTML5 doctype,不区分大小写 -->
<html lang="zh-cmn-Hans"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
    <meta charset='utf-8'> <!-- 声明文档使用的字符编码 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- 优先使用 IE 最新版本和 Chrome -->
<title>百万数据前端快速流畅显示</title>
<style type="text/css">
#box {position: relative; height: 300px; width: 200px; border:1px solid #CCC; overflow: auto}
#box div { position: absolute; height: 20px; width: 100%; left: 0; overflow: hidden; font: 16px/20px Courier;}
</style>
<div id="box"></div>
<script type="text/javascript">
var total = 1e5
@barretlee
barretlee / index.html
Created November 11, 2014 14:14
Move Obj Demo // source http://jsbin.com/canizo/1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Move Obj Demo</title>
<style id="jsbin-css">
html, body {
height: 100%;
overflow: hidden;
}
@barretlee
barretlee / gulpfile.js
Created March 25, 2015 07:12
gulpfile test
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var minicss = require('gulp-minify-css');
var rename = require("gulp-rename");
var del = require('del');
gulp.task('clean', function(cb) {
del(['build'], cb);
});
@barretlee
barretlee / package.json
Created March 25, 2015 07:13
package for gulpfile
{
"name": "conve",
"author": "Barret Lee",
"version": "0.0.1",
"description": "",
"scripts": {},
"license": "MIT",
"devDependencies": {
"gulp": "~3.8.6",
"gulp-uglify": "0.2.1",
@barretlee
barretlee / .gitignore
Created March 25, 2015 07:13
normal gitignore file
tmp
*.log
node_modules
bower_components
.idea/*
lib