Skip to content

Instantly share code, notes, and snippets.

@HereChen
HereChen / window_onLoad.js
Last active August 29, 2015 14:28 — forked from tao4yu/window_onLoad.js
Javascript : window.onload 绑定多个事件
/*
*假设有2个函数firstFunction和secondFunction需要在网页加载完毕时执行, 需要绑定到window。onload。如果通过:
*
* window.onload = firstFunction;
* window.onload = secondFunction;
* 结果是只有secondFunction会执行,secondFunction会覆盖firstFunction。
*/
/*
*正确的方式是:
@HereChen
HereChen / gist:11254286
Last active August 29, 2015 14:00 — forked from romanz/gist:968198
matlab: git
function [status, result] = git(varargin)
cmd = '"c:\Program Files\Git\cmd\git.cmd"';
for i = 1:numel(varargin)
cmd = [cmd ' ' varargin{i}];
end
switch nargout
case 0, system(cmd);
case 1, [status] = system(cmd);
case 2, [status, result] = system(cmd);