Skip to content

Instantly share code, notes, and snippets.

View eob's full-sized avatar

Ted Benson eob

View GitHub Profile
<div class="insert-exhibit">
<link href="http://people.csail.mit.edu/eob/drupal2/datapress/user/role/principal__investigators/json" rel="exhibit/data" type="application/json">
<style>
/*
* These get rid of the extra bits that Exhibit takes the liberty of adding.
* ------------------------------------------------------------------------------
*/
@eob
eob / gist:5688792
Last active December 17, 2015 23:19
# In resource-controller.js
ResourceController = function(provider) {
this.a = 1;
};
ResourceController.prototype.printA = function(req, res) {
res.send(typeof this.a);
};
var test = function() {
return "This is a test!";
}
CTS.Parser = {
/* Parses a forrest (externally linked) CTS sheet.
*
* Args:
* - spec: the spec to parse
* - format: the format which encodes the spec
* - fromUrl: the url which loaded the spec
*
* Returns:
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading CSS" />
<title>CTS Example: Loading CSS</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@css http://getbootstrap.com/2.3.2/assets/css/bootstrap.css;
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading JS" />
<title>CTS Example: Loading JS</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@js http://code.jquery.com/jquery-1.10.1.js;
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading HTML" />
<title>CTS Example: Loading HTML</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@html theme http://treesheets.csail.mit.edu/mockups/blog/twenty-thirteen/index.html;
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading HTML" />
<title>CTS Example: Loading HTML</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@html theme http://treesheets.csail.mit.edu/mockups/blog/twenty-thirteen/index.html;
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading HTML" />
<title>CTS Example: Loading HTML</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@html theme http://treesheets.csail.mit.edu/mockups/blog/twenty-thirteen/index.html;
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CTS Example: Loading HTML with an alias" />
<title>CTS Example: Loading HTML with an alias</title>
<script src="http://treesheets.org/cts.js"></script>
<style type="text/cts">
@html theme http://treesheets.csail.mit.edu/mockups/blog/twenty-thirteen/index.html;