Visit my blog or connect with me on Twitter
git init
or
Visit my blog or connect with me on Twitter
git init
or
| var searchForSubject = function(model, event){ | |
| _subjectSearchText = event.srcElement.value; | |
| console.log(_subjectSearchText); | |
| // simple first algorithm - | |
| // wait for 1 second | |
| // search if | |
| // the search string is non-falsey | |
| // the string at the start of the timeout is the same as the current | |
| // the search string is at least 3 characters |
| try | |
| { | |
| return IsTrue(val); | |
| } | |
| catch | |
| { | |
| return IsFalse(val); | |
| } | |
| // moar koad |
| public interface IJudgeDread | |
| { | |
| void IAmTheLaw(); | |
| } | |
| public interface IRoboCop : IJudgeDread | |
| { | |
| void ServeThePublicTrust(); | |
| function find(root, obj) { | |
| var seen = []; | |
| function search(root, name, depth) { | |
| if (root === obj) { | |
| console.log(name); | |
| return; | |
| } | |
| if (!depth) { return; } | |
| if (seen.indexOf(root) >= 0) { return; } | |
| if (typeof root !== "object") { return; } |
| jQuery.fn.aspHide = function() { | |
| $(this).each(function() { | |
| var elem = $(this); | |
| elem.data('height', elem.height()); | |
| elem.height('0'); | |
| elem.css('visibility', 'hidden'); | |
| }); | |
| }; | |
| jQuery.fn.aspShow = function() { |
| function setup(method) | |
| { | |
| window[method] = fake; | |
| }; | |
| var fake = function() | |
| { | |
| return "faked"; | |
| }; |
| // 1: how could you rewrite the following to make it shorter? | |
| /*if (foo) { | |
| bar.doSomething(el); | |
| } else { | |
| bar.doSomethingElse(el); | |
| }*/ | |
| (foo) ? bar.doSomething(el) : bar.doSomethingElse(el); |