Skip to content

Instantly share code, notes, and snippets.

View LeezQ's full-sized avatar
🏠
Working from home

allence LeezQ

🏠
Working from home
View GitHub Profile
@LeezQ
LeezQ / gitconfig
Created September 2, 2013 05:38
my git config file
[user]
name = LeezQ
email = [email protected]
[push]
default = simple
[alias]
st = status
co = checkout
ci = commit
br = branch
@LeezQ
LeezQ / css 常用
Created September 2, 2013 11:37
css 一些常用
/*
* css线性渐变:
* http://www.w3cplus.com/content/css3-gradient
*/
background: -webkit-linear-gradient(top,#fff,#ededed, #fff);
/*
* 带有角度的
*/
background:-webkit-linear-gradient(45deg, #ef3c60 0, #f55679 50%, #f66c8b 50%, #f76f8d 100%);
@LeezQ
LeezQ / js-method
Created September 11, 2013 07:22
js 常用
$.ajax({
url: '/twitter/newtwitter',
type: "POST",
timeout: 60000,
data: data,
dataType: 'json',
success: function(json){
if (json == null) {
alert(MGLANG.msgTimeout);
} else {
@LeezQ
LeezQ / serializeObject.js
Created September 24, 2013 06:34
用于 form 将 searilized 数据转为 json
(function($) {
/**
* code from stackoverflow:
* http://stackoverflow.com/questions/1184624/convert-form-data-to-js-object-with-jquery
*
* 用于处理 serializeAray 数据后格式
*
* <form id="form">
* <input type="text" name="lname" value="lee"/>
* <input type="text" name="fname" value="zq"/>
@LeezQ
LeezQ / gist:4226d6187a945be1530c
Created February 27, 2015 05:45
commonjs 和 amd 规范封装事例代码
(function(factory){
//判断客户端还是服务端
var isWindow = ( typeof window !== 'undefined' ? true : false );
var global = ( isWindow ? window : this );
if (typeof module !== 'undefined' && module.exports) {
module.exports = factory();
}
// AMD RequireJS
else if (typeof define !== 'undefined' && define.amd) {
@LeezQ
LeezQ / Gulpfile.js
Created February 28, 2015 07:40
gulpfile 示例文件,带 svn 提交
/**
* system modules
* @type {[type]}
*/
var fs = require('fs');
var exec = require('child_process').exec;
/**
* gulp node modules
* @type {[type]}
@LeezQ
LeezQ / webpack.config.js
Last active August 29, 2015 14:16
webpack demo file
module.exports = {
entry: {
config_index: "./src/config_event/config_index.js",
new_event: "./src/new_event/new_event.js",
event_list: "./src/event_list/event_list.js",
},
output: {
path: 'dist/src' ,
filename: "[name].js"
@LeezQ
LeezQ / Enhance.js
Last active August 29, 2015 14:20 — forked from sebmarkbage/Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@LeezQ
LeezQ / vertical-align.css
Created May 4, 2015 14:47
图片垂直居中
.swipe-wrap > div a {
-webkit-transform-style: preserve-3d;
display: block;
}
.swipe-wrap a img {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@LeezQ
LeezQ / js.jade
Created May 11, 2015 04:34
jade 中使用 Inline script
simply use a 'script' tag with a dot after.
script.
var users = !{JSON.stringify(users).replace(/<\//g, "<\\/")}