Skip to content

Instantly share code, notes, and snippets.

(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))
(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
},
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>
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++)
{
<!-- 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 f = function(args, body) {
return Function(args, body);
};
var alertFoo = f("foo","alert(foo)");
alertFoo("bar");
public class when_retrieving_groups : BaseSpec
{
[Fact]
public void can_retrieve_all_groups()
{
Assert.NotEmpty(_groupsRepository.GetAll());
}
[Fact]
public class Minnow : App
{
public Minnow(Context context)
: base(context)
{
get("/", index);
}
private void index(Context context)
{
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;
@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);