This file contains hidden or 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
// If foo is true, then we do all this stuff | |
if (foo) { | |
// Do foo stuff | |
} | |
// This is the stuff that happens in the else case | |
else { | |
// asdf here is 'QWER' because we like it | |
var asdf = 'QWER'; | |
// zoobie ... well, what to say about zoobie | |
var zoobie = 'FRANG'; |
This file contains hidden or 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 wm = windmill.jsTest; | |
var asserts = windmill.controller.asserts; | |
var test_openProject = new function () { | |
this.test_click = function () { | |
wm.actions.click( { link: "Food" } ); | |
}; | |
this.test_wait = { method: "waits.forPageLoad", params: { timeout: "20000" }}; |
This file contains hidden or 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
// Totally naive mixin for demonstration purposes | |
var mixInProperties = function (to, from) { | |
for (var p in from) { | |
to[p] = from[p]; | |
} | |
} | |
// Base pseudoclass | |
var InheritedCodeObj = function (id) { | |
this.id = id || '(none)'; |
This file contains hidden or 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 isArray = function (obj) { | |
return obj && | |
typeof obj === 'object' && | |
typeof obj.length === 'number' && | |
typeof obj.splice === 'function' && | |
!(obj.propertyIsEnumerable('length')); | |
}; |
This file contains hidden or 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<style type="text/css"> | |
div { | |
border: 1px solid red; | |
width: 400px; | |
} | |
textarea { | |
margin: 0 -11px; |
This file contains hidden or 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
node> var parentFunc = function () { this.a = []; }; | |
node> typeof parentFunc; | |
'function' | |
node> var foo = new parentFunc(); | |
node> foo; | |
{ a: [] } | |
node> var subFunc = function () {}; | |
node> subFunc.prototype = foo; | |
{ a: [] } | |
node> var bar = new subFunc(); |
This file contains hidden or 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 assertImageLoaded = function (img) { | |
var complete = img.complete; | |
// Workaround for Safari -- it only supports the | |
// complete attrib on script-created images | |
if (typeof complete == 'undefined' || complete === false) { | |
var test = new Image(); | |
// If the original image was successfully loaded, | |
// src for new one should be pulled from cache | |
test.src = img.src; | |
complete = test.complete; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> | |
<script type="text/javascript" src="./showdown.js"></script> | |
<title> | |
Markdown Viewer | |
</title> | |
<style type="text/css"> |
This file contains hidden or 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 MyThing = function () { | |
this.a = function () { | |
}; | |
this.b = []; | |
this.c = 'foo'; | |
}; | |
MyThing.prototype = new (function () { | |
var MY_SETTING = 2112; | |
var _myPrivateFunc = function () { |
This file contains hidden or 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
js> null > -1; | |
true | |
js> null < 1; | |
true | |
js> null > 0; | |
false | |
js> null < 0; | |
false | |
js> null == 0; | |
false |
OlderNewer