Skip to content

Instantly share code, notes, and snippets.

View joelburget's full-sized avatar

Joel Burget joelburget

View GitHub Profile
data Matrix : Vect n Nat -> Type -> Type where
Mat : (foldr Vect a dims) -> Matrix (Vect n Nat) a
@joelburget
joelburget / ProjectFeedback.jsx
Last active January 4, 2016 17:39 — forked from pamelafox/ProjectFeedback.jsx
nolint example
/* This class is used to create the /topic/projectfeedback page,
* which shows expandable lists of feedback requests that need answering.
*/
var ProjectFeedbackPage = React.createClass({
propTypes: {
topic: React.PropTypes.string.isRequired
},
render: function() {
var helpCollection = new DiscussionItemCollection([], {
topic: this.props.topic,
@joelburget
joelburget / lenses.js
Created January 10, 2014 21:51
js lenses
var getter = function(obj, lens) {
return _(lens).foldl(function(focused, element) {
return focused[element];
}, obj);
};
var modifier = function(obj, lens, mod) {
if (lens.length === 0) {
return mod(obj);
} else {
<!DOCTYPE html>
<html>
<head>
<title>Gravity!</title>
<script src="processing.js"></script>
</head>
<body>
<canvas id="pjs" width="400" height="400"></canvas>
<script data-processing-target="pjs">
var canvas = document.getElementById("pjs");
@joelburget
joelburget / gist:1110568
Created July 27, 2011 23:13
Not removing?
filename = os.path.join(os.path.dirname(__file__), \
'../js_css_packages/packages_hash.py')
if os.path.isfile(filename):
print "\n\n\n%s\n\n\n" % filename
os.remove(filename)
# file not removed but prints 'deploy/../js_css_packages/packages_hash.py'
@joelburget
joelburget / models.py
Created July 26, 2011 17:35
Don't save empty UserData
class UserData(db.Model):
...
def put(self, **kwargs):
# Only store the UserData if there is something worth storing
if self.points > 0 or self.coaches != [] or self.student_lists != [] \
or self.moderator:
super(UserData, self).put(**kwargs)