Skip to content

Instantly share code, notes, and snippets.

View languageNode.json
{
"category": "main",
"components": [
"google", {"regex":"\\s*"}, {"regex":".*"}
]
}
View XLSForm.js
/* Requires underscore.js */
var SERVER_URL = "http://ec2-50-16-84-43.compute-1.amazonaws.com/xlsform/2/json_workbook/";
/*
//The ideal approach would be to send the workbook as an xlsx blob
//and process it the same way as user uploads.
//Unfortunately I can't figure out how to generate such a blob.
function sendBlob() {
var file = DocsList.getFileById(SpreadsheetApp.getActiveSpreadsheet().getId());
View index.html
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Widget</title>
<base target="_blank" />
View languageNode.json
{
"category": "main",
"components": [
"population of ", {"regex":"[\\w\\s]{2,20}", "tag" : "country"}, " since ", {"regex":"\\d{4}", "tag" : "from_year"}
],
"url": "http://nathanathan.github.com/LanguageWidgets/plotWidget.html"
}
View yql.js
$.getJSON("http://query.yahooapis.com/v1/public/yql/", {
"env":"http://github.com/spier/yql_worldbank/raw/master/alltables.env",
"q":'SELECT * FROM worldbank.data(0,100) WHERE indicator_id = "SP.POP.TOTL" AND country_id = "GHA" AND from_year = 1980 AND to_year = 1985',
"format": "json",
"jsonp" : "?"
}, function(res) {
console.log(res.query.results.data);
});
View languageNode.json
{
"category": "s_exp",
"components": [
{"regex": "\\(\\s*\\)"}
],
"implementation": "function () {return [];}",
"asyncImpl": "callback([])"
}
View languageNode.json
{
"category": "example widgets",
"components": [
"paint a picture"
],
"url": "http://ngokevin.github.com/gogh/"
}
View languageNode.json
{
"category": "s_exp",
"components": [
"+"
],
"implementation": "function(){return (function (cdr){return cdr.reduce(function(a, b) {return a + b}, 0);});}"
}
View languageNode.json
{
"category": "s_list",
"components": [
{"category": "s_exp"}
]
}
View languageNode.json
{
"category": "s_exp",
"components": [
{"regex": "[^\\s\\d'\"()]+"}
]
}