Skip to content

Instantly share code, notes, and snippets.

var doStuff = function() {
// do some awesome stuff
};
setInterval(doStuff, 100);
var doStuffLoop = function() {
doStuff();
setTimeout(doStuffLoop, 100);
};
doStuffLoop();
var isDoingStuff = false,
possiblyDoStuff = function() {
if (!isDoingStuff) {
isDoingStuff = true;
doStuff();
isDoingStuff = false;
}
};
using (Browser browser = new IE("http://www.google.com"))
{
browser.TextField(Find.ByName("q")).TypeText("watin");
browser.Button(Find.ByName("btnG")).Click();
Assert.IsTrue(browser.ContainsText("WatiN Home"));
}
var gistPrefix = 'http://gist.github.com/',
cachedWrite = document.write,
body = $('body'),
gists = $('p.gist').map(function(n, p) {
p = $(p);
var a = $('a', p),
href = a.attr('href');
if (a.length && href.indexOf(gistPrefix) == 0) {
var z="http://gist.github.com/",y=document.write,x=$("body"),w=$("p.gist").map(function(b,a){a=$(a);var c=$("a",a),u=c.attr("href");if(c.length&&u.indexOf(z)==0)return{p:a,id:u.substring(z.length)}}).get(),v=function(){if(w.length==0)document.write=y;else{var b=w.shift();document.write=function(){document.write=function(a){b.p.replaceWith(a);v()}};x.append('<scr'+'ipt src="'+z+b.id+'.js"></scr'+'ipt>')}};v();
var gistPrefix = 'http://gist.github.com/',
// Cache document.write so that it can be restored once all Gists have been
// embedded.
cachedWrite = document.write,
body = $('body'),
// Map each p.gist to an object that contains the paragraph to be replaced
// and the Gist's identifier.
gists = $('p.gist').map(function(n, p) {
p = $(p);
var message = 'Hello!';
(function() {
var message = 'Hi!';
alert(message);
})();
var message = 'Hello!';
(function() {
alert(message);
var message = 'Hi!';
})();
var message = 'Hello!';
(function () {
var message;
alert(message);
message = 'Hi!';
})();