Skip to content

Instantly share code, notes, and snippets.

@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);
public class App
{
private Context _context = null;
private List<IHandler> _getHandlers = null;
private List<IHandler> _postHandlers = null;
private List<IHandler> _putHandlers = null;
private List<IHandler> _deleteHandlers = null;
public class Minnow : App
{
public Minnow(Context context)
: base(context)
{
get("/", index);
}
private void index(Context context)
{
public class when_retrieving_groups : BaseSpec
{
[Fact]
public void can_retrieve_all_groups()
{
Assert.NotEmpty(_groupsRepository.GetAll());
}
[Fact]
var f = function(args, body) {
return Function(args, body);
};
var alertFoo = f("foo","alert(foo)");
alertFoo("bar");
<!-- All the "runat=server" tags are so the markup can be used by DotNetNuke. I don't know if that contributed to the problem or not. It didn't appear to. -->
<div class="maincontent">
<table class="maintable">
<tr>
<td id="leftTallContent" runat="server">
</td>
<td id="middleContent">
<div id="doc3" class="yui-t7">
<div id="bd">
<div class="yui-gb">
var url = $(e.target).attr("href");
if (url !== null && url != "" && url !== "undefined")
{
var params = (function() {
var qs = url.split("?");
var p = qs[1].split("&");
var params = {};
var l = p.length;
for(var c=0;c<l;c++)
{
var template = "<div><h3><a>{{Title}}</a></h3><div id='{{Title}}'><ul>{{#items}}<li><a href='{{.href]}}'>{{.title}}</a><li>{{/items}}</ul></div>";
//.href doesn't work, not sure how to access the members of {{.}} in the enumerable section.
var tutorials = { Title: "Tutorials", items: [ {href: "http://foo", title: "foo"},{href:"http://bar", title: "bar"}];
Mustache.to_html(template, tutorials);
/*
should output
<div><h3><a>Tutorials</a></h3><div id='Tutorials'><ul><li><a href='http://foo'>foo</a><li><li><a href='http://bar'>bar</a><li></ul></div>