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
(import '(winterwell.jtwitter Twitter)) | |
(defn connect-to-twitter [] | |
(let [twitter (new Twitter "lazycoder" "NotMyRealPassword")] | |
(do (println "Connecting to Twitter")) | |
(do (println (. twitter (getStatus "lazycoder")))) | |
twitter) | |
) | |
(do (connect-to-twitter)) |
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
(function (a) { | |
a.browserTest = function (e, g) { | |
var f = "unknown", | |
d = "X", | |
b = function (k, j) { | |
for (var c = 0; c < j.length; c = c + 1) { | |
k = k.replace(j[c][0], j[c][1]) | |
} | |
return k | |
}, |
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 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> |
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 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++) | |
{ |
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
<!-- 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"> |
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 f = function(args, body) { | |
return Function(args, body); | |
}; | |
var alertFoo = f("foo","alert(foo)"); | |
alertFoo("bar"); |
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
public class when_retrieving_groups : BaseSpec | |
{ | |
[Fact] | |
public void can_retrieve_all_groups() | |
{ | |
Assert.NotEmpty(_groupsRepository.GetAll()); | |
} | |
[Fact] |
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
public class Minnow : App | |
{ | |
public Minnow(Context context) | |
: base(context) | |
{ | |
get("/", index); | |
} | |
private void index(Context context) | |
{ |
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
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; | |
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
// 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); | |