This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name user js demo | |
// @description share | |
// @version 1.0 | |
// @author Jeffy | |
// @match http://*.tudou.com/* | |
// ==/UserScript== | |
$("body").css('background','#EEE'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test() { | |
return arguments[0]; | |
} | |
var obj = { | |
test: test, | |
call: function (fn, args, context) { | |
context = context || null; | |
if (Array.isArray(args)) { | |
fn.apply(context, args); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var expect = chai.expect; | |
function test() { | |
return arguments[0]; | |
} | |
var testJSON = __html__['test/fixtures/test.json']; | |
var CID = 1; | |
function fn() { | |
CID++; | |
} | |
var obj = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('timer Demo', function () { | |
var clock; | |
beforeEach(function () { | |
clock = sinon.useFakeTimers(); | |
}); | |
afterEach(function () { | |
clock.restore(); | |
}); | |
it('setTimeout', function () { | |
var spy = sinon.spy(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('XMLHttpRequest Demo', function () { | |
var xhr, requests; | |
beforeEach(function () { | |
xhr = sinon.useFakeXMLHttpRequest(); | |
requests = []; | |
xhr.onCreate = function (XHR) { | |
requests.push(XHR); | |
}; | |
}); | |
afterEach(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// | |
// * set all enforcing options to true |