Skip to content

Instantly share code, notes, and snippets.

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
@skoon
skoon / IRoboCop.cs
Created September 9, 2011 08:15 — forked from grumpydev/IRoboCop.cs
public interface IJudgeDread
{
void IAmTheLaw();
}
public interface IRoboCop : IJudgeDread
{
void ServeThePublicTrust();
@skoon
skoon / find.js
Created December 27, 2010 23:39 — forked from creationix/find.js
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; }
@skoon
skoon / aspHide
Created October 15, 2010 00:17 — forked from buzzedword/gist:627318
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() {
@skoon
skoon / gist:590069
Created September 21, 2010 17:18 — forked from karlseguin/gist:590059
function setup(method)
{
window[method] = fake;
};
var fake = function()
{
return "faked";
};
@skoon
skoon / screening.js
Created September 13, 2010 20:29 — forked from rmurphey/screening.js
// 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);