Skip to content

Instantly share code, notes, and snippets.

@willwei
willwei / git-branch.md
Created May 17, 2016 09:55 — forked from yisibl/git-branch.md
在Mac、Linux 终端显示 Git 当前所在分支

在Mac、Linux 终端显示 Git 当前所在分支

  1. 进入你的home目录
cd ~
  1. 编辑.bashrc文件
$.ajax({
url: "/getData",
timeout:3000 //3 second timeout
}).done(function(){
//do something
}).fail(function(jqXHR, textStatus){
if(textStatus == 'timeout')
{
alert('Failed from timeout');
//do something. Try again perhaps?
@willwei
willwei / snow
Created December 17, 2014 13:43
function k(a, b, c) {
if (a.addEventListener) a.addEventListener(b, c, false);
else a.attachEvent && a.attachEvent("on" + b, c)
}
function g(a) {
if (typeof window.onload != "function") window.onload = a;
else {
var b = window.onload;
window.onload = function() {
@willwei
willwei / jsonp.md
Last active August 29, 2015 13:56
JSONP

利用Script标签可以跨域请求
返回的script中:my_callback({['some string 1', 'some data', 'whatever data']});
已定义好的函数:my_callback(){}

#蘑菇街面试经历 ##DOCTYPE类型以及区别 ##CSS性能优化 ##float ##清楚浮动的方法 ##display:none和visibility:hidden ##animate 动画队列,如何解决callback中调用callback ##KISSY 框架 ##JSONP为什么能够跨域

@willwei
willwei / function.md
Created January 23, 2014 08:23
我们将详细讲解一下各种类型的函数是如何影响上下文的变量对象以及每个函数的作用域链都包含什么。

#EcmaScript function ##概要 In this article we will talk about one of the general ECMAScript objects — about functions. In particular, we will go through various types of functions, will define how each type influences variables object of a context and what is contained in the scope chain of each function. We will answer the frequently asked questions such as: “is there any difference (and if there are, what are they?) between functions created as follows:
在这一章节中,我们来探讨下ECMAScript中一个很重要的对象-函数。我们将详细讲解一下各种类型的函数是如何影响上下文的变量对象以及每个函数的作用域链都包含什么,我们将回答诸如像下面这样的问题:下面声明的函数有什么区别么?(如果有,区别是什么)。

var foo = function () {
  ...
};

from functions defined in a “habitual” way?:

@willwei
willwei / position.md
Last active January 2, 2016 19:19
position:absolute

s

@willwei
willwei / ieGradientOpactiy.md
Last active January 2, 2016 19:09
IE下使用filter实现纯色背景半透明

IE滤镜采用AARRGGBB(16进制)进行排列,AA位值也为 00-FF,也就是说10进制需要转成16进制 计算规则 10进制值*256/100然后再转16进制,就是说如果设置0.4的透明度40*256/100 = 102.4转16进制为66

  .rgba .test{ 
    background:rgba(255,255,255,.4); 
    background:none\9; 
    filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr=#66FFFFFF,endColorStr=#66FFFFFF);
  }
@willwei
willwei / kissy_oop.js
Created December 5, 2013 08:23
KISSY OOP 组件编写
/**
* [Con_fun description]
* @param {[type]} container [description]
* @param {[type]} config [description]
* 继承关系
*/
function Con_fun(container,config){
var self = this;
if (!(this instanceof Con_fun)){
@willwei
willwei / zindex.md
Last active December 28, 2015 18:09
今天遇到了个z-index的问题,做下笔记吧。

#问题描述: ##环境 IE全家 ##具体描述 <!doctype html> <title>normal mode</title>